|
|
#1 |
|
Prospect
Join Date: Jan 2002
Posts: 5
|
Convert line endings (CR/LF)
Does anyone know a good utility to convert DOS line endings to Mac?
I've tried Linebreak Converter X and Cyclone X 1.5.1. Nether of them worked for me. I have about a hundred megs of text files. Thanks, Dan |
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: Jan 2002
Location: California
Posts: 113
|
Open the file in BBEdit with "Preferences" set to CR/LF. Then change the "Preferences" to Mac style line endings and save the file with a "Save as".
If you do not have/use BBEdit, and do not want to spend for the full version, just download their Lite version, which is free. Even that versin can do this operation. -- sbj
|
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jan 2002
Location: Milwaukie, OR
Posts: 48
|
Here's a shell script that will work for you...
Code:
#! /bin/sh
for x
do
echo "Converting $x"
tr -d '\015' < "$x" > "tmp.$x"
mv "tmp.$x" "$x"
done
Code:
chmod +x dos2UNIX.sh Code:
./dos2UNIX.sh [ab]*.dos HTH, Jim |
|
|
|
|
|
#4 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
perhaps sed will service your needs:
from the sed 1liners... http://www.dbnet.ece.ntua.gr/~george/sed/1liners.txt TEXT CONVERSION AND SUBSTITUTION: # IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format sed 's/.$//' # assumes that all lines end with CR/LF sed 's/^M$//' # in bash/tcsh, press Ctrl-V then Ctrl-M sed 's/\x0D$//' # sed v1.5 only |
|
|
|
|
|
#5 |
|
Prospect
Join Date: Jan 2002
Posts: 5
|
Thanks
Thanks All!
I took the lazy way out and did it on the Windows side using Eluent. http://www.eluent.com/ Dan |
|
|
|
|
|
#6 | |||||||||||||||||||||||
|
Triple-A Player
Join Date: Jan 2007
Posts: 82
|
How do you put "Ctrl-V" and "Ctrl-M" into a script? |
|||||||||||||||||||||||
|
|
|
|
|
#7 | |||||||||||||||||||
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,941
|
The part you quoted from is telling you literally what to type:
__________________
hayne.net/macosx.html |
|||||||||||||||||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|