Hi,
I have 2 files as below:
file1 (take note that this is an 800MB-sized file)
111111,1111
222222,2222
333333,3333
and
file2 (4MB file)
111111
444444
333333
I need to compare 1st field of both files and produce field2, as below:
1111
3333
I tried this (based from another post):
awk -F"," 'FILENAME=="file1"{A[$1]=$1} FILENAME=="file2"{if(A[$1]){print}}'
and this (also based from another post):
nawk -F"," 'BEGIN{while(getline<"file1") a [$1]=1 } ; a [$1] ==1 {print $2 }' file2
Both didn't work for me.
Hope you can help.
Thanks!