i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -
compare:
nawk 'NR==FNR{a[$0]++;next;} !a[$0] {print"line":" FNR $0}' file1 file2
duplicate:
nawk '{a[$0]++}END{for(i in a){if(a[i]-1)print i,a[i]}}' file1
in the middle of script i get an error message saying
nawk: out of space in tostring on record 971360
I am using a file having 2 million records.