I am processing a fairly big collection of Tweets and I\'d like to obtain, for each tweet, its mentions (other user\'s names, prefixed with an @
), if the mentio
The idiomatic way to process two separate files, or the same file twice in awk is like this:
awk 'NR==FNR{
# fill associative array
next
}
{
# use the array
}' file1 file2
The total record number NR
is only equal to the record number for the current file FNR
on the first file. next
skips the second block for the first file. The second block is then processed for the second file. If file1
and file2
are the same file, then this passes through the file twice.