[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

awk field separator



I don't know about gawk, which has some improvements over traditional
awk, but in base awk the answer to your question is no.  

With perl, you can split based on any regular expression, so, for
instance,

perl -ne '@f = split(/[;:\\]/); print $f[0],"\n";'

would split the line into fields separated by any of the characters in
the brackets, and then print only the first field on a line by itself.