Dear All,
I have two sets of files. File 1 can be any number between 1 and 20 followed by a frequency of that number in a give documents... the lines in the file will be dependent to the analysed document. e.g.
file1
1,5
4,1
then I have file two which is basicall same numbers but with frequency of 0
file2
1,0
2,0
3,0
4,0
...
20,0
I want to create a third file which will map the file1 on file2
file3 - outcome
1,5
2,0
3,0
4,1
...
20,0
I have tried
awk -F, 'FNR==NR{X[$1]=$2;next}$1 in X{print $1","X[$1]==$2;next}{print $1","0}' file1 file2
but it does not print what is required and puts 0 for any item from file1
Can you please help?