D
Dan van Ginhoven
Hi!
I had some files on my Linux server containing Dos/Win style CRLF and also
trailing spaces on most lines.
I ran this one-liner perl on them:
cat localfn | perl -p -e "s/\r//;s/\s*$//;" > tempname
To my surprise both CR and LF was removed and I ended up with a file with
just one long line.
When I changed the one-liner to
cat localfn | perl -p -e "s/\r//;s/\s*$/\n/;" > tempname
it came out OK.
What am I missing?
Can any point me to the appropriate FAQ or man page please.
/dg
I had some files on my Linux server containing Dos/Win style CRLF and also
trailing spaces on most lines.
I ran this one-liner perl on them:
cat localfn | perl -p -e "s/\r//;s/\s*$//;" > tempname
To my surprise both CR and LF was removed and I ended up with a file with
just one long line.
When I changed the one-liner to
cat localfn | perl -p -e "s/\r//;s/\s*$/\n/;" > tempname
it came out OK.
What am I missing?
Can any point me to the appropriate FAQ or man page please.
/dg