in reply to Re^4: different length of a line from linux and windows textfile? ("\r")
in thread different length of a line from linux and windows textfile?
On Windows chomp will remove both "\n" and "\r\n".
D:\test>od -c win32.txt 0000000 l i n e o n e \r \n l i n e +t 0000020 w o 0000022 D:\test>od -c nix.txt 0000000 l i n e o n e \n l i n e t +w 0000020 o \n 0000022 D:\test>perl -pi.bak -e "chomp $_;" win32.txt D:\test>perl -pi.bak -e "chomp $_;" nix.txt D:\test>od -c win32.txt 0000000 l i n e o n e l i n e t w +o 0000020 D:\test>od -c nix.txt 0000000 l i n e o n e l i n e t w +o 0000020
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: different length of a line from linux and windows textfile? (still wrong)
by tye (Sage) on Mar 17, 2014 at 22:34 UTC | |
by fishmonger (Chaplain) on Mar 17, 2014 at 23:39 UTC | |
by tye (Sage) on Mar 17, 2014 at 23:51 UTC |
In Section
Seekers of Perl Wisdom