Page 1 of 1

Skip n. line before match pattern

Posted: 16 Apr 2019 09:21
by darioit
Hello folks,
here another problem, I had to read text file and print it, but when I match a string starting tag AB3 for example year "2019" I want to skip raw (unknow) find and raw until prev tag AB3, after continue to read file with same method

ex.
AB1 data
AB2 data
AB3 2017
AB1 data
AB3 2018
AB1 data
AB3 2019

How can I do this?
Thank you in advance

Re: Skip n. line before match pattern

Posted: 17 Apr 2019 04:47
by darioit
Solved put each row in a temp file and when match row print temp file