I don't know of an option in grep itself for this, but you can use sed to extract the lines, and then pass them through your grep command (since you already have the command you want), or try to do the whole thing in sed. If you're running the command a large number of times in a tight loop, the all sed version will probably run faster as ou will have half the number of process invocations, but if you're not doing it more than a few dozen times or the efficiency isn't an issue, don't worry about that.
For example, sed will output lines 200 to the end of the file if you do this command:
Code:
$ sed -n '200,$ p' input_file
The -n option says, "don't print each line unless it is explicitly printed in the program".
The sed program, provided in 'single quotes' says: for lines 200 to the end of the file, do command p (print line). The first part,
200,$ is the address specification. You can use lines numbers, special addresses like
$ to mean the end of the file, or patterns, which can be used to look in the contents of the line, and start or end when a certain pattern is encountered.
Just pipe the output into your grep statement and you're laughing, i.e.
Code:
$ sed -n '200,$ p' input_file | grep -o "&#[[:digit:]]\{5\};"