I have a list of names and several different files that may or may not contain all the names in the list and a value assigned to the names. I need to compare the values of all these each file to the names in the list. These are the kind of txt files I have
List
Alligator mississippiensis
Anas platyrhynchos
Anolis carolinensis
Chrysemys picta
Columba livia
Gallus gallus
File1
Alligator mississippiensis 2546
Anas platyrhynchos 32
Columba livia 21571
Gallus gallus 226
File2
Anas platyrhynchos 2
Anolis carolinensis 3255
Chrysemys picta 225
Columba livia 2215
Gallus gallus 22548
And this is the output format I need, where the first line would be the name of the files, indicating where the values came from ...
List File1, File2
Alligator mississippiensis 2546,0
Anas platyrhynchos 32,2
Anolis carolinensis 0,3255
Chrysemys picta 0,225
Columba livia 21571, 2215
Gallus gallus 226, 22548
I thought of something like grep and finding the list name in the file, print column 2, if it does not find print 0 ..
Can anyone help?