On 08/30/2015 06:22 PM, ToddAndMargo wrote:
Hi All,
DuckDuckGo is failing me here.
I need to do a
awk -F "two hex codes" '{print $1}'
The two hex codes are C2 and A0
What is the syntax to put them in the "-F"?
Many thanks,
-T
On 08/30/2015 07:56 PM, Brad Cable wrote:
> Try defining it in the FS variable in BEGIN{}, seems to work for me.
>
> $ echo -e "ASD\xC2\xA0QWE\xC2\xA0JKL" | awk 'BEGIN{FS="\xC2\xA0"} {print
> $1}'
> ASD
>
>
> -Brad
Just trivia. A guy showed me how to do this with Perl:
$ echo -e "ASD\xC2\xA0QWE\xC2\xA0JKL\xC2\xA0MNO" | perl -F'/\xC2\xA0/'
-lane 'print "$F[0] $F[1] $F[2] $F[3]"'
ASD QWE JKL MNO