How to remove \r character with sed
You should be able to do it with sed
like this:
sed 's/\r//g' orig.txt > modified.txt
In case you are using the terminal on a mac, use this instead to be able to recognize \r
sed "s/$(printf '\r')\$//" orig.txt > modified.txt