Horje
tr unix use Code Example
tr unix use
# Operate a substitution in a file, for example changing spaces into tabs
cat myfile.txt | tr " " "\t" > my_new_file.txt
# You can also operate a character substitution 
cat myfile.whatever | tr "[a-z]" "[A-Z]" > my_new_file.whatever
# another example, change tabs into new line characters 
#(convert tab-separated column into rows)
cat myfile.tsv | tr "\t" "\n" > my_new_file.txt
###---
###---
#I find it particularly useful to change IFS instead of using in-place sed like:
sed -i 's/ /\t/g' myfile.txt

#Best!




Shell

Related
bash copy contents of file to clipboard Code Example bash copy contents of file to clipboard Code Example
laptop slow performance linux Code Example laptop slow performance linux Code Example
ubuntu 755 and 644 Code Example ubuntu 755 and 644 Code Example
ubuntu server clean up disk space Code Example ubuntu server clean up disk space Code Example
stop npm running on port 3000 Code Example stop npm running on port 3000 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9