Hi,
I do not know what file you are using for this code.
Here is the mytext.txt like file example I posted in the beginning (see below)
When your code is used with it,
it prints one line:
some lines here
LotCompletestring found in line 7
>>>
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
And the question I asked before.
The two Vars below I declared.
lstr = '-- InitializeRequest'
lstart = 'LotComplete'
if the Vars "last_lstar and last lstr" both not None then what they are?
Where they get values?
The "print(last_lstart, last_str)" not really printing anything.
if last_lstart is not None and last_lstr is not None:
# I found a pair!
print(last_lstart, last_str) # Here is where you print your pair
thank you for coaching!
I started writing Python scripts about 3 weeks ago

and it is not easy for me.
