I'm rather new to Perl, having only had an introductory course - and now I'm doing some scripts for a friend. It's been, ah, educational.
The input was a couple of files with comma-delimited records, only some of the fields had embedded commas and were enclosed in double quotes. I'd never heard of CSV, so I reinvented the wheel and got it working. I later discovered Text::CSV, figured out how to install it - and that worked on my test data - but it choked on the diacritics when I ran it on the million-plus records for the real deal. I poked around and found Text::Undiacritic and attempted to install it, then poked around some more and figured out how to force the install. Whew.
That took care of the diacritics. Now it's choking on records that look something like this:
stuff,"more","foo (1994 "bar" only)",1234,1988,3.0,""
I think the problem is in the third field - it's enclosed in double quotes and contains a parenthesized portion which in turn contains a double-quoted string.
Worst case, I could fall back on my reinvention of the wheel, but that would be cheating.
I'd appreciate very much any help.
In reply to problems parsing CSV by helenwoodson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |