in reply to Splitting a comma-delimited string where a substring could contain commas

I'm curious as to why you ended up in this situation to begin with.

  1. Why do you need to have them split that way? (What is the ultimate goal you're trying to achieve using that data?)

  2. Do you have any control over how the initial data is structured? Smarter data structures make for easier maintenance.

I know this isn't the "answer" you were looking for, but if you can change the format of the data to something easier to work with, or if you can solve your problem without even having to parse it the way you think you need to, your maintenance programmer will thank you.
  • Comment on Re: Splitting a comma-delimited string where a substring could countain commas

Replies are listed 'Best First'.
Re: Re: Splitting a comma-delimited string where a substring could countain commas
by Anonymous Monk on May 05, 2002 at 19:30 UTC

    1) because I want to store them in a database, each column represents a field.

    2) Nope it was an excel sheet, I exported it to CSV.

    I can change the format, but that is what I want to avoid, because i would have to do it manualy