I have a problem with a
I have a file called
Uniprot_interactors.txt containing a list of codes (ex.
GRT986E) and sometimes between objects there are one or more empty lines.
In some other cases I have an object consisting of 2 parts divided by a low dash (ex.
TRY546 _ TRE578) and these lines must be considered as if they were empty.
After that I have another file
Good_interactors.txt containing a list of codes and for everyone a variable (es.
aaaaaa) is associated. I would like to get an output (
output.txt) from the
grep of these files but I want to keep the lines empty as in the first file.
QR846OI PO3R56 UJ6Y68 YU654R PL92WS GH654Y _ HUY765R PIHYUD
TYRT68Y aaaaaaaaa QR846OI bbbbbbbbb FDR59I cccccccc PO3R56 ddddddd UJ6Y68 eeeeeee VFR6y7 fffffff PIHYUD gggggggg UH7609 hhhhhhhh
output.txt(same format of file 1)
QR846OI bbbbbbbbb PO3R56 ddddddd UJ6Y68 eeeeeee YU654R PL92WS GH654Y _ HUY765R PIHYUD gggggggg
I tried to use this code:
grep -f Uniprot_interactors.txt GOOD_interactors.txt > output.txt
but the format of file 1 is not preserved and empty lines have been deleted.