Tool-BarfreeBSD ArticlesSearch Our SiteHOMEfreeBSD LinksContribute to FreeBSD HelpFreeBSD FilesFreeBSD Script Corner

Removing ^M from your files fast and with little effort

Doesnt it just drive you nuts to edit a file in Windows, and have a ^M at the end of each line ? Well with the following information, we can remove that. 

 Do the following :

'perl -i.bak -npe 's/\r\n/\n/g' <file>'

  Notes :
where <file> is the name of the file you want to "clean".
The original file is copied to <file>.bak...

  Thats all there is to it... nothing fancy.

  Article By: Rocky

© 1997 - 20013 Defcon1, , Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of and the content's original author.

Tool-Bar-2Defcon1  Webmail