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!