# a way to remove carriage returns in ASCII File



## mkwan (May 12, 2004)

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


thanks


----------



## brianleahy (May 12, 2004)

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.


----------



## scruffy (May 12, 2004)

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

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


----------

