Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

awk output field separator

Just use function split in awk command to split a line into an array 'a'
using a choosen string as delimiter as for example ", " in next use case:
echo "hi, bye, hey" | awk '{split($0,a,", "); print a[3],a[2],a[1]}'
Comment

awk use string as field separator

Just use function split in awk command to split a line into an array 'a'
using a choosen string as delimiter as for example ", " in next use case:
echo "hi, bye, hey" | awk '{split($0,a,", "); print a[3],a[2],a[1]}'
Or you could also do next:
echo "a, b, c" | sed 's/, /,/g' file.txt | awk -F ',' '{print $1 $2 $3}'
Comment

PREVIOUS NEXT
Code Example
Shell :: cookiecutter 
Shell :: spotify ubuntu 
Shell :: npm install postgresql 
Shell :: vscode update terminal limit 
Shell :: how to get process id in linux 
Shell :: bootar pendrive linux 
Shell :: remove last commit from remote 
Shell :: stash changes before checkout from the branch 
Shell :: kali linux ping ip 
Shell :: gtk3 windows install 
Shell :: sed line 
Shell :: ubuntu clone git repository 
Shell :: powershell filter 
Shell :: enviroment variables in firebase 
Shell :: Meaning of the GitHub message: push declined due to email privacy restrictions 
Shell :: fish set environment variable 
Shell :: how to setup path using git bash in windows 
Shell :: poetry requirements 
Shell :: bash assign array to variable 
Shell :: ssh rsa key login 
Shell :: crear una aplicacion con angular cli 
Shell :: write a script to shutdown at a time in linux 
Shell :: dockerfile env 
Shell :: linux vi 
Shell :: packet10 
Shell :: git close private repo 
Shell :: apt source "--ignore-missing" 
Shell :: how to troll someone 
Shell :: bash continue on error 
Shell :: build .so file 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =