whatisthis987
IS-IT--Management
Hi,
I have a file looks like this:
aaa bbb ccc ddd;
123 321 423 444;
aaa eee ccc ddd;
aaa fff ccc ddd;
12243455465467;
I want the output to look like this:
aaa bbb;
123 321 423 444;
aaa eee;
aaa fff;
12243455465467;
Basically, just remove the last 2 entries of the lines begin with "aaa" but preserve the semicolon.
I don't see how I can add a secondary or/and third search patterns in sed or vi. Can someone please help?
Thanks.
I have a file looks like this:
aaa bbb ccc ddd;
123 321 423 444;
aaa eee ccc ddd;
aaa fff ccc ddd;
12243455465467;
I want the output to look like this:
aaa bbb;
123 321 423 444;
aaa eee;
aaa fff;
12243455465467;
Basically, just remove the last 2 entries of the lines begin with "aaa" but preserve the semicolon.
I don't see how I can add a secondary or/and third search patterns in sed or vi. Can someone please help?
Thanks.