Skip to content

Instantly share code, notes, and snippets.

@Tux
Created January 24, 2016 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tux/1542d23b568508160329 to your computer and use it in GitHub Desktop.
Save Tux/1542d23b568508160329 to your computer and use it in GitHub Desktop.
$ dump crnl.csv
[DUMP 0.6.01]
00000000 31 2C 32 2C 2C 22 34 22 2C 22 35 20 77 69 74 68 1,2,,"4","5 with
00000010 20 5C 72 5C 6E 0D 0A 20 65 6D 62 65 64 64 65 64 \r\n.. embedded
00000020 22 2C 36 0D 0A ",6..
$ 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"
I need an option to leave every new-line sequence unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment