Removing Special Character from File.

Hi,

My file has this special character "^M"

I would like to remove this characters.

eg:

abc,abc,^M

i tried using sed but doesnt work.

i used octal dump command to see special character it returns following:
015
\r

Appreciate your reply.

Use "dos2unix" on that file.

Tried:

$ dos2unix file

ksh: dos2unix: not found

Also Tried:

sed 's/^M//g' file> file1

The file1 still has the special character ^M

Appreciate reply

tr -d '\015' <file >new
mv new file

there are lot of other ways possible...

sed, awk, tr, vim ....

Deleting dos chars using Vim (^M) The eternal fight between admins and computers
^M and vim

try

sed 's/\^M//g' file1

Thanks this one worked.