Sed processes dos CR/LF in files
Replace the dos control character ^ M
# IN unix ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format)
Sed's / ^ M $/ /'# in bash/tcsh, press Ctrl-V then Ctrl-M
Sed's Universe. Assumes that all lines end with CR/LF.
Sed's /\ x0DharmAccord'# gsed 3.02.80, but top script is easier
# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
Sed "spockets" / `echo-e\ r` / "# command line under ksh
Sed's Universe'"/ `echo\ r` /" # command line under bash "
Sed "spockets / `echo\ r` /" # command line under zsh
Sed's _ gsed /\ r _
# IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format
Sed "sswab" / "# method 1"
Sed-n p # method 2
# IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
# Cannot be done with DOS versions of sed. Use "tr" instead.
Tr-d\ r outfile # GNU tr version 1.22 or higher
Example: delete all blank lines and lines consisting of spaces in the file
$cat ifile | sed'/ ^ $/ d' | sed'/ ^ [[: space:]] * $/ d' # method 1
$cat ifile | sed-e'/ ^ $/ d'- e'/ ^ [[: space:]] * $/ d'# method 2