Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

tr unix use

# Operate a substitution in a file, for example changing spaces into tabs
cat myfile.txt | tr " " "	" > 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 "	" "
" > my_new_file.txt
###---
###---
#I find it particularly useful to change IFS instead of using in-place sed like:
sed -i 's/ /	/g' myfile.txt

#Best!
Comment

PREVIOUS NEXT
Code Example
Shell :: add npm to $PATH ubuntu 
Shell :: delete lines text file linux 
Shell :: how to delete all branches in git except master 
Shell :: update submodule 
Shell :: github restore previous commit 
Shell :: bash grep for two terms in same line 
Shell :: yum clean all 
Shell :: ngb-tabset install 
Shell :: ubuntu upgrade certbot acme v2 
Shell :: how to merge branch to master 
Shell :: how to revert a git stash 
Shell :: bash get environment variable 
Shell :: git alias - multiple commands 
Shell :: ubuntu install gnote 
Shell :: git revert to last commit 
Shell :: powershell get OS 
Shell :: webpack install webpack config 
Shell :: kde increase fpsz 
Shell :: create folder with shell/bash 
Shell :: anaconda install package 
Shell :: remove all files matching a pattern in subdirectories 
Shell :: cmd delete folder and all contents 
Shell :: docker load 
Shell :: git history 
Shell :: install git lfs 
Shell :: install gradle 
Shell :: push docker image to docker hub 
Shell :: Impossible de trouver le paquet php-gettext 
Shell :: run command as root administrator mac 
Shell :: Server unable to read htaccess file 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =