The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 02-12-2009
trichyselva trichyselva is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 65
Hi,
Let me explain the problem


The below few lines are from one file called retst.out
I just copied few of the lines by opening the file in vi mode
you can see the [dos] in the lines below (in vi editor)

Input file in dos mode
------------------------

2008110803000200050000011 10.0000 10.0000
2008111503000200050000011 10.0000 10.0000
2008112203000200050000011 10.0000 10.0000
2008112903000200050000011 10.0000 10.0000

"retst.out" [dos] 52L, 3016C


Same file after converting it into unix mode

2008110803000200050000011 10.0000 10.0000
2008111503000200050000011 10.0000 10.0000
2008112203000200050000011 10.0000 10.0000
2008112903000200050000011 10.0000 10.0000
"retst.out" 52L, 2964C



I will use the below lines for converting my file from dos mode to unix mode

tr -d '\15\32' < retst.out > 1.txt
mv 1.txt retst.out


If you see the file above I am seeing any ctl+M (^M) characters in the file
This conversion I am asking.

How to do the same

thanks