 <p>No need to call <code>awk</code> several times. You can do everything with a single <code>awk</code> script. Try the following command:</p> <pre><code>awk -f t.awk GW2.log </code></pre> <p>where <code>t.awk</code> is:</p> <pre><code>NR==5 { RDS_T=$1 } NR==6 { RDS_P=$1" "$2 } NR==8 { RDS_C1=$1" "$2 } NR==9 { RDS_C2=$1" "$2 } NR==16 { ALGN_T=$1 } END { fmt="%-12s %-12s %-18s %-18s %-18s %-18s\n" printf fmt, "File", "Reads", "Paired reads", "Conc reads1", "Conc Reads2", "Total align" printf fmt, "GW2.log", RDS_T, RDS_P, RDS_C1, RDS_C2, ALGN_T } </code></pre> <p>with output:</p> <pre><code>File Reads Paired reads Conc reads1 Conc Reads2 Total align GW2.log 3746112 3746112 (100.00%) 581094 (15.51%) 227387 (6.07%) 28.15% </code></pre>