perl -lpe 'BEGIN{$/ = "\r\n"}' -i.bak filename.txt