I have a large file with around 15 million lines. The odd lines contains the keys (but not only the keys) and the even lines are the data. That is, the file is something like:
WRTZ Tyrosine 1287998798 ASDF Proline 9408654860 TYSR Serine 9809804090 ASDF Cytosine 4950409808
The keys here are
I have a list of around 100000 keys. I want to extract the data (both lines) corresponding to these keys.
One approach I tried was to
grep the lines containing the keys to get the line numbers and then extract the line and the next line using
tail in a loop. However, this seems to take a long time to run.
Is there a more efficient way to do this?