olivierp has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a Microsoft application generated CSV file (encoded with MS's variant of Unicode), where certain fields can contain a newline.
To my demise, they are not quoted as they neither contain the field separator OR the Windows eol marker. E.g it looks like this:
Field1,Field2,Field3\r\n
text\ncontinued,"I have a comma, so I'm quoted",I don't\r\n
I've tried Text::xSV & Text::CSV, and both get trapped on the embedded newline.
Is there something I'm missing to coax either module (or another suggestion) to handle this cleanly ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Handling an embedded newline in an unquoted CSV field
by tobyink (Canon) on Dec 10, 2011 at 18:30 UTC | |
|
Re: Handling an embedded newline in an unquoted CSV field
by bluescreen (Friar) on Dec 10, 2011 at 14:19 UTC | |
|
Re: Handling an embedded newline in an unquoted CSV field
by Tux (Canon) on Dec 10, 2011 at 10:30 UTC | |
by 3dbc (Monk) on Dec 10, 2011 at 14:27 UTC | |
|
Re: Handling an embedded newline in an unquoted CSV field
by TJPride (Pilgrim) on Dec 10, 2011 at 14:15 UTC |