Reputation: 45
I am trying to use two data pipeline, ||
, as delimiter in AWK command. But I am unable to do it. I have a file in which I have to consider two data pipeline as delimiter, just like considering TAB or COMMA as delimiter.
Upvotes: 0
Views: 328
Reputation: 9891
Just tell awk to interpret the | literally with []
:
awk -F'[|][|]' ...
Example:
» echo "1 || 2" | awk -F'[|][|]' '{ print $2 }'
2
Upvotes: 2