Space Separated awk '{ $5 = $2 - $4 } 1' inputput.txt > outdiff.txt Or with tab separation: awk 'BEGIN { OFS = "\t" } { $5 = $2 - $4 } 1' inputput.txt > outdiff.txt