[RESOLVED] Parsing Question
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: [RESOLVED] Parsing Question

  1. #1
    Join Date
    Apr 2000
    Location
    Washington (state)
    Posts
    125

    [RESOLVED] Parsing Question

    This is NOT a VB question per se... it is more of an Excel csv parsing question... I didn't know which would be the best forum to pose the question and I am using VB so that is why I chose this forum...

    Hypothetical situation...

    Making a CSV file...
    Line one has three columns with this content

    Code:
    first          A,B"C       third
    
    If I make the string
    first,A,B"C,third
    
    It is interpreted as
    first         A              B"C        Third
    
    If I make the string
    first,"A,B"C",third
    
    It is interpreted as
    first        A,BC"         third
    How do I get it to ignore the imbedded commas and quotes in the second field?????

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,860

    Re: Parsing Question

    You must surround anything with embedded commas with Quotes and I think you need to double up on quotes to get them to come in though not sure on the latter

    A,"B,C",D

    Would be A B,C D

    It is generally better to use tab delimited files

  3. #3
    Join Date
    Apr 2000
    Location
    Washington (state)
    Posts
    125

    Re: Parsing Question

    Thanks DM... I decided to switch to Tab as the delimiter...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center