Difference between revisions of "SED"

From Tomelec
Jump to: navigation, search
(Created page with "== Text editing with SED == === lower case to UPPER CASE === Convert all characters from lower case to upper case. <nowiki>sed ’s/./\u&/g’ infile.txt > outfile.txt</nowiki>")
 
 
Line 1: Line 1:
== Text editing with SED ==
+
== lower case to UPPER CASE ==
=== lower case to UPPER CASE ===
 
 
Convert all characters from lower case to upper case.
 
Convert all characters from lower case to upper case.
 
  <nowiki>sed ’s/./\u&/g’ infile.txt > outfile.txt</nowiki>
 
  <nowiki>sed ’s/./\u&/g’ infile.txt > outfile.txt</nowiki>
 +
 +
== UNIX text to DOS text (CR/LF) ==
 +
Convert/add line endings
 +
<nowiki>sed 's/$'"/`echo \\\r`/" infile.txt > outfile.txt </nowiki>

Latest revision as of 13:49, 30 January 2012

lower case to UPPER CASE

Convert all characters from lower case to upper case.

sed ’s/./\u&/g’ infile.txt > outfile.txt

UNIX text to DOS text (CR/LF)

Convert/add line endings

sed 's/$'"/`echo \\\r`/" infile.txt > outfile.txt