Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

[SOLVED] How to set field separator in awk when FS is "||" ?

$
0
0
Dear Experts,

How to use field separator in awk , when the field separation is needed as "||"



Example: (file1 )

Code:

aa || bb  ||  cc || 1234
xx || yy  ||  zz  || 1123





Q:

If I want to print $3 and $4 only , with using the field separator "||"
How to write awk code:

I am trying :

Code:

#  awk -F "||" '{print $3 , $4 }  file1


But not working,

Thanks in advance,
Rveri.

Viewing all articles
Browse latest Browse all 16232

Trending Articles