Hi
I am using grep to extract a certain pattern in the example files below. How do I extract pattern 'T1' and not 'T123'?
the output should be:
Thank you for your help
Joseph
I am using grep to extract a certain pattern in the example files below. How do I extract pattern 'T1' and not 'T123'?
Code:
cat pattern
id
T1
T23
T55
Code:
cat file
id name length
T5 Lypla1 2433
T55 sea3 2668
T123 Tmea1 2671
T23 nrea1 2564
T1 mea1 250
T10 mrty1 22
Code:
grep -f pattern file
id name length
T55 sea3 2668
T123 Tmea1 2671
T23 nrea1 2564
T1 mea1 250
T10 mrty1 22
the output should be:
Code:
id name length
T1 mea1 250
T23 nrea1 2564
T55 sea3 2668
Joseph