Difference between revisions of "Tr"

From wikieduonline
Jump to navigation Jump to search
Line 27: Line 27:
 
* <code>[[awk]]</code>
 
* <code>[[awk]]</code>
 
* <code>[[paste]]</code>
 
* <code>[[paste]]</code>
* <code>[[cut -d]]</code>
+
* <code>[[cut]], [[cut -d]]</code>
 
* <code>[[column]]</code>
 
* <code>[[column]]</code>
 
* <code>[[tr -d]] '\r'</code>
 
* <code>[[tr -d]] '\r'</code>

Revision as of 20:30, 25 June 2022

wikipedia:tr (Unix) translate characters


Concatenate lines on a file:

Concatenate/merge every 2 lines:

cat /path/tofile.txt | paste -d " "  - -[1]


cat file | tr '\n' 
tr: when not truncating set1, string2 must be non-empty


tr --help
tr: illegal option -- -
usage: tr [-Ccsu] string1 string2
       tr [-Ccu] -d string1
       tr [-Ccu] -s string1
       tr [-Ccu] -ds string1 string2

Related commands

See also

  • https://stackoverflow.com/a/9605450
  • Advertising: