Artificial intelligent assistant

awk one single line I am trying to use an awk script that compiles several lines into one; how can I do that? I'm using the command: awk < $pot/towhee.prod 'NR==411{print$5,$6}''NR==412{print$5,$6}''NR==430{print$7,$8}' and it produces this: 0.24975E-01 0.00000E+00 0.36574E+04 0.59343E+02 -3340.691 0.399 but I want this: 0.24975E-01 0.00000E+00 0.36574E+04 0.59343E+02 -3340.691 0.399 How can I do it?

You could set the _output record separator_ to a space (or tab). If you want the output to be printed with a terminating newline, you can change it back before the final print


awk 'BEGIN{ORS=" "} NR==411{print$5,$6}''NR==412{print$5,$6}''NR==430{ORS="\
"; print$7,$8}'

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 31b3e18123bfd30c18f9d29a5f851f1b