I am trying to print the first line of first column and second column into single column with awk. I am using the following awk one-liner
awk 'NR==1{printf $1 OFS; next}{print $2}' infile > new_file
Input:
A123 154.1
A123 158.1
A123 159.4
Expected Output:
A123
154.1
158.1
159.4
But the resulted output from the one-liner is as follows
A123 154.1
158.1
159.4
I would like to what mistake causes the change in output. I included '\n' in the code but not helping.
Thank you in advance