Adding column using awk

Hello everyone,

I have a file with the following structure:

abc xyz 111 222
agf hjhf 787 799
tht yah 878 898
... ... ... ...
... ... ... ...
... ... ... ...

I want to add a column (with a fixed value of 1000) at the end such that it becomes:

abc xyz 111 222 1000
agf hjhf 787 799 1000
tht yah 878 898 1000
... ... ... ... 1000
... ... ... ... 1000
... ... ... ... 1000

Any inputs as to how to do this using awk ?

Thanks!

You can certainly do it with awk,
but it's even easier with sed:

sed 's/$/ 1000/' infile

And awk

$ awk '$(NF+1) = 1000' file
abc xyz 111 222 1000
agf hjhf 787 799 1000
tht yah 878 898 1000
... ... ... ... 1000
... ... ... ... 1000
... ... ... ... 1000
awk ' $NF=$NF" 1000" ' file
perl -pe 's/$/ 1000/' urfile
awk '$0=$0" 1000"' file