I have a file with about 3 Million lines and I am tring to extract certain lines from the file. I can grep the line that I want but I also want to grep the four lines that follow. If I use the -e option to grep the other four lines I get nearly the whole file since each line format is very similar. The trick being that I want to grep a certain number first then the next four lines then goto the next number.
So for example I want to grep 12345 then the next four lines then 12345 again then the next four lines skiping everything between the last line in the set of four and the next 12345 match. Is this possible with a grep statement?
Hoping for help,
ckattola
So for example I want to grep 12345 then the next four lines then 12345 again then the next four lines skiping everything between the last line in the set of four and the next 12345 match. Is this possible with a grep statement?
Hoping for help,
ckattola