a way to remove carriage returns in ASCII File

mkwan

Tech
I was wonder if there was a way to remove escape sequences or carriage returns in an ASCII File(the easy way)?


thanks
 
You can load the file in BBEdit, and when you save it, specify the option for "Unix carriage returns".

In HPUX there's also a command called 'dos2ux' that converts text files, but I dunno if Darwin has anything comparable.
 
dos to unix:
perl -pi -e 's/\r\n/\n/;' file.txt

mac to unix:
perl -pi -e 's/\r/\n/;' file.txt
 
Back
Top