BreadCrumbs: Tr Command
Tr Command
From Luke Jackson
(Difference between revisions)
Revision as of 23:05, 21 December 2008 (edit) Ljackson (Talk | contribs) ← Previous diff |
Current revision (10:41, 27 February 2014) (edit) Ljackson (Talk | contribs) |
||
Line 4: | Line 4: | ||
tr '\t' ',' <input_file> <output_file> | tr '\t' ',' <input_file> <output_file> | ||
+ | |||
+ | Replace "New Line Character" (Return) with comma: | ||
+ | |||
+ | cat fontprds.txt | tr -s "\r\n" "," | ||
+ | |||
+ | Convert string from upper case to lower case: | ||
+ | |||
+ | tr '[:upper:]' '[:lower:]' | ||
+ | |||
+ | Convert Windows Line Break to Unix | ||
+ | |||
+ | tr -d "\r" |
Current revision
[edit]
Examples
Convert tab delimited data into comma delimited:
tr '\t' ',' <input_file> <output_file>
Replace "New Line Character" (Return) with comma:
cat fontprds.txt | tr -s "\r\n" ","
Convert string from upper case to lower case:
tr '[:upper:]' '[:lower:]'
Convert Windows Line Break to Unix
tr -d "\r"