• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1527
  • Last Modified:

Using sed to remove control-M from a series of files

I program in DOS and LINUX and often transfer files back and forth.  When I take a file from DOS to LINUX, control-M characters are added at the end of each line.  While these can be removed in textedit one by one, I have a number of files and want to automate it.  I would guess that sed could remove the character from a group of files, but I have no idea how to do it.
0
wiggin
Asked:
wiggin
1 Solution
 
ozoCommented:
tr -d '\015'
0
 
feenixCommented:
You can use this in a script:

sed s/^V^M// < file.dos > file.unix

0
 
ozoCommented:
assuming
stty lnext ^V
0
 
ahoffmannCommented:
Linux has: duconv      :-))
You also may use: mcopy -t
0
 
jrgCommented:
There is a utility on SunOS machines named "dos2unix"
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now