I have an excel file which contains the lines I want to extract from the original file. There are a few issues:

1) that I do not have standardized lines aka identifiers. So I cannot use a command with a sole keyword, say http for the example in parentheses (i.e. sed -n -e '/http/ p' myfile)

My lines are more like the following:

HWI-ST513:311:C1JADACXX:7:1306:16522:83878

HWI-ST513:311:C1JADACXX:7:1101:10012:62095

2) That the original text file is large and I need to extract a subset of the lines, of which the index is too long to type manually.

Instead of giving a keyword, can I use an index file (my excel file) within a command? In this way, I am hoping to pull out the whole line related to the identifiers above.

So the output would be something like this:

HWI-ST513:311:C1JADACXX:7:1306:16522:83878 n2 n0 n0 Diptera Insecta Arthropoda n0

HWI-ST513:311:C1JADACXX:7:1101:10012:62095 n2 n0 Spilogona Muscidae Diptera Insecta

 I tried to find related questions, seemingly sed and shuf are the most common commands for extracting certain lines.

More Bilgenur Baloglu's questions See All
Similar questions and discussions