I need help with extract/print lines till stop pattern. This needs to happen after every 3rd occurrence of start pattern and continue till end of file. Consider below is an example of the log file. my start pattern will be every 3rd occurrence of ERROR_FILE_NOT_FOUND and stop pattern will be Stop_pattern
ERROR_FILE_NOT_FOUND
some textlsjljsl
ERROR_FILE_NOT_FOUND
some textjljss0
ERROR_FILE_NOT_FOUND
some textwwkw
Extract line 1
Extract line 2
Extract line 3
Stop_pattern
some text99mlll
ERROR_FILE_NOT_FOUND
some textjsjsj1
ERROR_FILE_NOT_FOUND
some text9kk
ERROR_FILE_NOT_FOUND
some textllsljlj
Extract line 5
Extract line 6
Extract line 7
Stop_pattern
some textljljljsl
ERROR_FILE_NOT_FOUND
some textppi
ERROR_FILE_NOT_FOUND
some textnnn
ERROR_FILE_NOT_FOUND
some texthkhk
Extract line 9
Extract line 10
Extract line 11
Stop_pattern
desired output:
Extract line 1
Extract line 2
Extract line 3
//separator if possible
Extract line 5
Extract line 6
Extract line 7
//separator if possible
Extract line 9
Extract line 10
Extract line 11
//separator if possible
---------- Post updated at 02:21 PM ---------- Previous update was at 02:11 PM ----------
ignore the input/output provided in last thread here's correct one however problem statement remains same
ERROR_FILE_NOT_FOUND
some text
ERROR_FILE_NOT_FOUND
some text
ERROR_FILE_NOT_FOUND
Extract line 1
Extract line 2
Extract line 3
Stop_pattern
some text
ERROR_FILE_NOT_FOUND
some text
ERROR_FILE_NOT_FOUND
some text
ERROR_FILE_NOT_FOUND
Extract line 5
Extract line 6
Extract line 7
Stop_pattern
some text
ERROR_FILE_NOT_FOUND
some text
ERROR_FILE_NOT_FOUND
some text
ERROR_FILE_NOT_FOUND
Extract line 9
Extract line 10
Extract line 11
Stop_pattern
desired output:
Extract line 1
Extract line 2
Extract line 3
Extract line 5
Extract line 6
Extract line 7
Extract line 9
Extract line 10
Extract line 11