Для удаления ^M (DOS перевод строки):
tr -d \r < dosfile > newfile
Please note: JavaScript is required to post comments.