awk built-in variable for input file

Hi guys,

Does awk have a built-in variable which I can use to display the input file it's currently reading?

I'm currently concatenating multiple files using awk and later on do some parsing. But for now, I want to add an extra column in the main output data file - basically putting in the file name it's currently reading.

E.g.

Input1.txt
brandon USA
sherley Russia

Input2.txt
Albert Alaska

Output.txt
brandon USA Input1.txt
sherley Russia Input1.txt
Albert Alaska Input2.txt

Thanks!

$ echo "this is file1" > file1
$ echo "this is file2" > file2

$ awk '{ print FILENAME ":" $0 }' file1 file2
file1:this is file1
file2:this is file2

HTH

awk '{print $0 FS FILENAME}' input*.txt

thanks guys!