Quote:
Originally Posted by
geekosaur
Does the first file have a space after the ">"? If so, look at the "join" command.
oh, I guess the problem with
join is that the lines in each file are separated by other lines, whitout the identifiers and with diffeent content (didn't mention this before, sorry..). And their order must not be broken, so they cannot be sorted before using
join.
So the files are:
file1:
>word1
ererererererererer
>word2
ghghghghghg
hjhjhjhjhjh
>word3
bnbnbnbnbnbnb
the identifier is '
>', the
'word..' can be whatever, the lines are separated by lines with whatever content.
file2:
Query= wordA
ghghgffkjghrhrhrh
qpqpqpqpqpqpqpqq
Query= wordB
fhfhfhfhf gjgjgj hkhkhkh
tyt5757
Query= wordC
ghghdjdjdj00
the identifier is '
Query= ', the 'word..' is not identical to the one in file1, but comes in the right order (word1~wordA, word2~wordB, etc). There is a space after the 'Query=', the lines are separated by other lines with different content.
the needed result:
>wordA
ererererererererer
>wordB
ghghghghghg
hjhjhjhjhjh
>wordC
bnbnbnbnbnbnb
Maybe someone has a idea how to do this automatically into shell?