2
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 on the list. These are the type 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 name of the list in the file, print column 2, if not find print 0..
Can anyone help?
Thanks Joao, it worked perfectly for 2 files, but I have 600... I’m trying to edit here, but help is always welcome!
– Silvia Justi
@Silvia, And you want to write 600 different columns?
– JJoao
Yes, this is my sample size (hence the despair... rs)
– Silvia Justi
But I already got a solution in the forum in English... I will post the link. Thank you very much!
– Silvia Justi
http://stackoverflow.com/questions/43853049/combining-several-text-files-in-a-comparative-way/43855774#43855774
– Silvia Justi
Did you ever see the hiccup I proposed yesterday?
– JJoao