I run the following command, which works fine while their contents are in the first file:
awk -F, 'FNR==NR {a[tolower($1)]++; next} !a[tolower($1)]' OutSideSyncUsers.csv NewUsers.csv
If the first file is empty, the command does not work. I found this link online:
all programs using the idiom of two files will not work correctly if the first file is empty (in this case awk will perform the actions associated with NR == FNR when reading the second file). To fix this, you can strengthen the condition NR == FNR by adding a test that checks that also FILENAME is equal to ARGV [1].
I am not sure that I understand how (or where) in the request to add a test check equal to ARGV [1]
Any help would be apperciated
source
share