On OSX I need to remove line-ending CR (\\r) characters (represented as ^M in the output from cat -v) from my CSV file:
\\r
^M
cat -v
Try the unix2dos command.
Example: unix2dos infile outfile
http://en.wikipedia.org/wiki/Unix2dos
The wikipedia page has some examples using perl and sed too.
perl -i -p -e 's/\n/\r\n/' file sed -i -e 's/$/\r/' file