I have a text file in unix with fields separated with "^^"
Example:-
bipin^^ajith
unix^^code
How can I use awk to print first and second fields from this file?
cat test.txt | awk -F"^^" ' { print $1 " " $2 } '
I have a text file in unix with fields separated with "^^"
Example:-
bipin^^ajith
unix^^code
How can I use awk to print first and second fields from this file?
cat test.txt | awk -F"^^" ' { print $1 " " $2 } '
awk -F"^" '{print $1 " " $3}' test.txt
$ cat sample12.txt
abc^^def
ghi^^jml
$ tr -s "^" <sample12.txt | awk -F"^" '{print $1 " " $2}'
abc def
ghi jml
$ tr -s "^" <sample12.txt | awk -F"^" '{print $1,$2}'
abc def
ghi jml