I have a 2GB text file and I want to read every line 100 lines after a certain string is found example:
string: 'epicvar (string) ="5"'
string
was found on line 5000 so I want to read the file from 5000 to 5100
then the string
was also found on line 15000 so I want to read the file from 15000 to 15100
and so on.
The system used is HP-UX B.11.31 U
This may work for you (untested), if you understand ll2p
means last line to print
it should be easy enough to read...
awk '/pattern/ {ll2p = NR+100}
NR < ll2p {print}
NR==ll2p {ll2p=0} ' file