Hi all
I am too new with programing to solve this problem. I have two files, file1 containing the index, file2 includes information I want.
1. file1
CU_91
CU_495
CW_79
CU_22
CW_42
2. file2
CW_79 protein1
CW_15 protein2
CW_16 protein3
CW_17 protein4
CW_42 protein5
I want to add extra information from file 2 to file 1 without changing the order in file one, as following. How could I do that?
CU_91
CU_495
CW_79 protein1
CU_22
CW_42 protein5
Thank you!
Alexie
Hi russhh!
Thank you for your help.
I tried this method but failed to get the result, I think there are two problems 1)I can't sort file 1 since I need the order information 2)For some reason, my system is not recognizing "join -t $'\t'" and gave the error message "join: illegal tab character specification". I changed file two with command
sed 's/ /\t/g'
I believe 'join' requires the input to be sorted, but Alexei want's to maintain the order.
I don't know of a good way to do it that doesn't require writing a program and keeping stuff in memory (or something similar).