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 :: move to folder in command line windows 
Shell :: background ubuntu 
Shell :: sms_autofill flutter 
Shell :: linux ssh into machine with private key 
Shell :: grep output options 
Shell :: dir command 
Shell :: To add repo from github in linux 
Shell :: upload on s3 
Shell :: hugo documentation 
Shell :: lighthouse 
Shell :: terraform vpc 
Shell :: sed replace into new file 
Shell :: git repo 
Shell :: search for substring 
Shell :: ubuntu camera not longer found 
Shell :: Cocoapods not found in android studio but flutter run works 
Shell :: kubernetes setup 
Shell :: curl x imap 
Shell :: std error bash 
Shell :: .bash_profile mac mvn 
Shell :: powershell equivalent of rm 
Shell :: open a file from the integrated terminal in Visual Studio Code? 
Shell :: bash source in lxc 
Shell :: grep string in file 
Shell :: ssh-copy-id specific file 
Shell :: No project found at or above and neither was a --path specified 
Shell :: dum mysql db with cli 
Shell :: git disconnect user 
Shell :: upgrade spyer 4.2.0 in anaconda 
Shell :: wget -O /etc/enigma2/iptv.sh 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =