new to awk and try to do something that's probably simple but it's taking me a while. To simplify things, I have a text file called 'sample' and it contains the following line:
164516454242451BX%Apt 110 225 1784 Ohio USA
I want to get the following output using awk:
Apt 110 225
Is there a way I can split $1 so that "Apt" is a separate field? The code I'm trying is the below. I recieve no error, but the output is just 2 blank lines.
awk ' BEGIN { split($1," ","%") } print $2,$3,$4 END { print "" } ' sample