michellem has asked for the wisdom of the Perl Monks concerning the following question:
I've got comma delimited output from a database (Acess), and text fields output with quotes around them, and non-text fields (#s) don't. I need to split a line of this output into an array. Some of the text fields have imbedded commas. What's the best way to do this?
for example: 1,"Hugo, Inc.",4,"This is a test",34.5,"Marc, Cindy and Rob"
Needs to be:
Obviously, I can't split just by ',' and I can't split by "," either. Suggestions?1 Hugo, Inc. 4 This is a test 34.5 Marc, Cindy and Rob
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split problems
by infoninja (Friar) on Apr 11, 2001 at 20:50 UTC | |
by tilly (Archbishop) on Apr 12, 2001 at 06:28 UTC | |
|
Re: split problems
by traveler (Parson) on Apr 11, 2001 at 21:28 UTC | |
|
Re: split problems
by Chady (Priest) on Apr 11, 2001 at 21:15 UTC | |
|
Re: split problems
by mirod (Canon) on Apr 11, 2001 at 21:55 UTC | |
|
Re: split problems
by DeusVult (Scribe) on Apr 11, 2001 at 22:50 UTC | |
by michellem (Friar) on Apr 13, 2001 at 01:16 UTC |