awk - split only by first occurrence
i have a line like:
one:two:three:four:five:six
and i want to use awk to get $1 to be one and $2 to be
two:three:four:five:six
i know i can get it by doing sed before. that is to change the first
occurrence of : with sed then awk it by the new delimiter.
i want to know if there is an option to get awk to behave this way
so something like:
awk -F: '{print $1,$2}'
will print:
one two:three:four:five:six
i will also want to do some manipulations on $1 and $2. so i dont want
just to substitute the first occurrence of :
No comments:
Post a Comment