Skip n. line before match pattern

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Skip n. line before match pattern

#1 Post by darioit » 16 Apr 2019 09:21

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

darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Re: Skip n. line before match pattern

#2 Post by darioit » 17 Apr 2019 04:47

Solved put each row in a temp file and when match row print temp file

Post Reply