Hello masters of awk,
I am a basic user of awk and need some help using getline and would appreciate any help you could offer.
I have a file name parts with this content:
ABS1234
ABS5678
ABS9101
ABS2175
ABS8234
ABS9876
ABS0765
ABS9937
ABS2254
I am trying to get the file to look like this:
ABS1234 ABS5678 ABS9101
ABS2175 ABS8234 ABS9876
ABS0765 ABS9937 ABS2254
This is what I have tried but need some help with please:
Thanks in advance for your help!
-Joe
I am a basic user of awk and need some help using getline and would appreciate any help you could offer.
I have a file name parts with this content:
ABS1234
ABS5678
ABS9101
ABS2175
ABS8234
ABS9876
ABS0765
ABS9937
ABS2254
I am trying to get the file to look like this:
ABS1234 ABS5678 ABS9101
ABS2175 ABS8234 ABS9876
ABS0765 ABS9937 ABS2254
This is what I have tried but need some help with please:
Code:
awk '{ id1=$1;getline;id2=$1;getline;id3=$1;print $id1, $id2, $id3 }' parts
ABS9101 ABS9101 ABS9101
ABS9876 ABS9876 ABS9876
ABS2254 ABS2254 ABS2254
-Joe