I’m having trouble with this one. I need to get awk to print the working dir for each line processed, lets say in the first column of the output. Here the command I’m using :
awk -F, ' FNR==NR {idsA[$1]; next} $1 in idsA ' noms */node.csv
I’m processing with this command files in different directories.
here is a sample output :
12,,,-4.8938065
15,,,-3.9248969
16,,,-3.7229307
17,,,-3.5086633
18,,,-3.2806812
What I need :
working_dir,12,,,-4.8938065
working_dir,15,,,-3.9248969
working_dir,16,,,-3.7229307
working_dir,17,,,-3.5086633
working_dir,18,,,-3.2806812
How could I get this done ?
Any help or pointer would be greatly appreciated
you can use awk built in file name variable
$FILENAME.i suppose it comes with complete path of the file.
you can try for that and check