Reputation: 1
I have a text file called ID.txt that contains the following:
Here is a list of some ID's
b028888
c039481
b016396
c456039
Lets see if this stupid thing will work!
I am wanting to run a command that will search that file for the b-id's or c-id's. Any suggestions?
Upvotes: 0
Views: 584
Reputation: 20860
Lets say your data file is testdata.txt. You can use following commands to get IDs with b or c.
sed -n '/^b/p' testdata.txt
sed -n '/^c/p' testdata.txt
Upvotes: 1