Dear all,

I am trying to use awk to take values from a list and reprint them in a different format with text. Here is the script:

awk '{print "( resid",$1,"and name HN )( resid",$1,"and name",$2,") ",$3,$4 }' input.txt > output.txt

and the input.txt:

103 HN 9.29 1.76
105 HN 4.51 1.87
106 HN 36.22 2.71

but for some reason when I run this it will only give me the correct output for one line:

( resid 103 and name HN )( resid 103 and name HN ) 9.29 1.76

I am not sure how to get it to go through the entire list in my input. Any help would be much appreciated.