Apr-22-2020, 08:07 PM
Greetings!
I'm having a hard time with this problem.
I need to print only the last match of "second line" for each "first line".
The output should look like this:
First line, second line
First line, second line
Here is a kind of example of a file:
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some lines here and more
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some line here and more
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some line here and more
second lines to find --LotComplete some stuff here
second lines to find --LotComplete some stuff here
second lines to find --LotComplete some stuff here
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some lines here and more
second line to find --LotComplete some stuff here
Thank you.
I'm having a hard time with this problem.
I need to print only the last match of "second line" for each "first line".
The output should look like this:
First line, second line
First line, second line
Here is a kind of example of a file:
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some lines here and more
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some line here and more
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
second line to find --LotComplete some stuff here
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some line here and more
second lines to find --LotComplete some stuff here
second lines to find --LotComplete some stuff here
second lines to find --LotComplete some stuff here
some lines here
some lines here and more
first line to find --InitializeRequest more stuff
some lines here
some lines here and more
second line to find --LotComplete some stuff here
Thank you.