When I extract text from a database or a PDF file (using xpdf’s pdftotext), I got fields or words suffixed with special character ^M. Note that these ^M’s appear not only at the end of lines. I use the following command line to remove these annoying ^M’s:
sed ‘s/^M//’ my-text-file
where the ^M in above shell command line comes by pressing Ctrl-V and then Ctrl-M.