Keep duplicate searches with grep
Hi there,
I want to find word 1 and word 2 in the file concatenate.txt and find the lines that match. However, if I search for word1 three times, I would like the result to come out 3 times too. I have been trying different grep options but it doesn't work. I have also tried with a loop awk. Would you know how to do it?
$ grep 'word1\|word1\|word1\|word2' concatenate.txt
It returns:
>word1 CCUG 34288 CCUG34288T_0000003
>word2 T14V chromosome, complete genome
My ideal result would be:
>word1 CCUG 34288 CCUG34288T_0000003
>word1 CCUG 34288 CCUG34288T_0000003
>word1 CCUG 34288 CCUG34288T_0000003
>word2 T14V chromosome, complete genome
• 106 views
•
link
0 answers
No answers yet.
Log in to answer this question.
What have you tried so far? Please show some efforts before posting a question on this forum.
Please have a read through [[ Please read before posting a question ::: How To Ask A Good Question ]]