-
Hi all,
While trying on a problem that involved three files, I got stuck on how to proccess them simultaneously by AWK. I know that it can be done for two files, but for three I'm not sure, say compare a field from third file, with another field in file two, then from the result do something in the first file ..., general example for two files:
So, can AWK process three files at a time, or for that matter more than three, at once ?
Or the actions have to be done separately for two files at a time, and then continue with the other ones at a different step ? Does AWK support simultaneous multiple files processing ?
Thanks for your time.
Hi all,
While trying on a problem that involved three files, I got stuck on how to proccess them simultaneously by AWK. I know that it can be done for two files, but for three I'm not sure, say compare a field from third file, with another field in file two, then from the result do something in the first file ..., general example for two files:
Code:
awk 'NR==FNR{a[$0]=$1;next}
{...action for file_2 ....}
.......
END { print ....}' file_1 file2
So, can AWK process three files at a time, or for that matter more than three, at once ?
Code:
awk 'NR==FNR{a[$0]=$1;next}
{...action for file_2 ....}
{...action for file 3....}
END { print ....}' [red]file_1 file_2 file_3 ...[/red]
Or the actions have to be done separately for two files at a time, and then continue with the other ones at a different step ? Does AWK support simultaneous multiple files processing ?
Thanks for your time.