How to get rid of ^m

Hi all,

I am new to unix....pls help me with this.

I have a binary file generating output by passing arguments in bash.when i open the output file in VI i can see that ^m is included in between most of lines,as a result when i pass this file to my java application it dosent parse the data properly.

Can anyone guide me how can i remove this automatically when file is created.I did achieve this by :%s/^m//g method.But i am looking for en efficient manner as i cant perform the same all time.

Even dos2unix dosent seem usefull as it dosent remove ^m from entire document.Only part of removed.

Any help will be appreciated.

Thanx
Ashesh

Assuming you mean a text file, not a binary one, you can use that command:

tr -d '\r' < old > new

Hi Buddy,

Thanx a lot....this seems to work realy well...

But if thr any mechanism by which i can get rid of them during the file creation.The command i run to create the output is

./table.Linux-i386.bin -o r -t systemtagsys -t waferpos -t waferattr -t config -t systemtag -t rawdata -t wafertagsys -t limitfile -t varindex -t lottag aa.ad3 > output_file

I dont have the source code for ./table.Linux-i386,so i dont really know whts in tht.
-O is for the orientation for the output files.

I doubt if we can infer from this how ^m is added to the output file.
I also tried to ftp the file over in both BINARY and ASSCII mode but the problem remains the same in either case.

Regards
Ashesh

Just basic shell scripting given the above.

./table.Linux-i386.bin -o r -t systemtagsys -t waferpos -t waferattr -t config -t systemtag -t rawdata -t wafertagsys -t limitfile -t varindex -t lottag aa.ad3 | tr -d '\r' > output_file