[Boston.pm] parsing CSV string with a comma in it

2006-02-28 Thread Alex Brelsfoard
Hello all, I know there's gotta be a nice and easy way to do this. Basically take, for example, the following file: --FILE-- item1a,item2a,item3a part1, item3a part2,item4a,item5a,item6a item1b,item2b,item3b part1, item3b part2,item4b,item5b,item6b .. --FILE--

Re: [Boston.pm] parsing CSV string with a comma in it

2006-02-28 Thread Ben Tilly
This is not nearly as simple as people think. Text::CSV can do it, but the example code in the documentation isn't right. (It won't handle embedded returns.) Text::CSV_XS does do it correctly out of the box with its getline function but needs a binary install. You can implement getline with

Re: [Boston.pm] parsing CSV string with a comma in it

2006-02-28 Thread David Meyers
On Feb 28, 2006, at 11:40 AM, Alex Brelsfoard wrote: item1a,item2a,item3a part1, item3a part2,item4a,item5a,item6a item1b,item2b,item3b part1, item3b part2,item4b,item5b,item6b What would be the best way to handle this? Should I use something like Text::CSV handle this? Text::ParseWords