You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat crnl.pl
use v6;
my $fh = open "crnl.csv", :r, :!chomp;
.perl.say for $fh.lines;
$ perl6 crnl.pl
"1,2,,\"4\",\"5 with \\r\\n\n"
" embedded\",6\n"
That first line should have been:
"1,2,,\"4\",\"5 with \\r\\n\r\n"
as the \r is part of the data, not of an EOL
I need an option to leave every new-line sequence unchanged.
The nl attribute for open won't work, as I cannot know in advance what the EOL sequence in the stream/file is and besides, CSV allows mixed EOL, so «1,2,,4\r\n1,2,3,\r1,,3,4\n» is completely valid CSV for Text::CSV
As callers to the parsing process are allowed to open an already opened file (an IO stream), this new :preserve-nl attribute (or whatever it will be implemented as), should be alterable *after* the stream has been opened, so it can be changed to local behavior inside the parsing proces.
Migrated from rt.perl.org#127358 (status was 'new')
Searchable as RT127358$
The text was updated successfully, but these errors were encountered: