perl -pe1 infile > outfile #### perl -i.bk -pe1 file #### $/ = "\n"; $\ = "\r\n"; while (<>) { chomp; print; }