in reply to Remove CR from file on Windows
see perlre for the postive look-aheadperl -pe "s/\r(?=\n)//" winfile.txt > unixfile.txt
demo batch file:perl -i.bak -pe "s/\r(?=\n)//" winfile.txt > unixfile.txt
perl -e "print \"foo\r\nbar\r\nstuff\";" > f.txt perl -pe "s/(\s)/'['.ord($1).']'/esg" f.txt REM output: foo[13][10]bar[13][10]stuff perl -i.bak -pe "s/\r(?=\n)//" f.txt perl -pe "s/(\s)/'['.ord($1).']'/esg" f.txt REM output: foo[10]bar[10]stuff
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remove CR from file on Windows
by ikegami (Patriarch) on Feb 10, 2007 at 05:08 UTC | |
by davidrw (Prior) on Feb 10, 2007 at 13:19 UTC | |
by ikegami (Patriarch) on Feb 10, 2007 at 18:44 UTC |