![]() |
|
No such thing as a small change | |
PerlMonks |
Parsing MS SQL CSV export with Text::CSV_XSby andyford (Curate) |
on Oct 22, 2008 at 18:18 UTC ( #718823=perlquestion: print w/replies, xml ) | Need Help?? |
andyford has asked for the wisdom of the Perl Monks concerning the following question: I'm trying to parse some CSV data from a MS SQL dump, but it seems to contain some stuff that I can't see. I tried Text::CSV_XS first, but the parser can't even see the lines apparently. The following just gives no results at all.
I tried to step back and just split the lines like so The result there is that a couple unexpected characters (a y-umlaut and a thing that looks kinda like a "p") show up at the beginning of just the first line, even though the data has nothing but ASCII in it. Also, the while loop runs one too many times, as though the file has an empty line at the end, but it doesn't. I tried to view the non-printing stuff with "set list" in vim, but that just shows the normal "$" eol characters, just one at the end of each line. Update: solution! Brute force: strip the first two chars and remove all the CR's:
Back to
Seekers of Perl Wisdom
|
|