in reply to Re^2: Remove CR from file on Windows
in thread Remove CR from file on Windows
C:\foo>type foo.bat @echo OFF echo "making test file" perl -e "print \"foo\r\nbar\r\nstuff\";" > f.txt echo "showing test file" perl -pe "s/(\s)/'['.ord($1).']'/esg" f.txt echo "altering file" perl -i.bak -pe "s/\r(?=\n)//" f.txt echo "showing result" perl -pe "s/(\s)/'['.ord($1).']'/esg" f.txt C:\foo>foo.bat "making test file" "showing test file" foo[13][10]bar[13][10]stuff "altering file" "showing result" foo[10]bar[10]stuff C:\foo>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Remove CR from file on Windows
by ikegami (Patriarch) on Feb 10, 2007 at 18:44 UTC |