in reply to Edit huge file

see Re: use regular expressions across multiple lines from a very large input file for a discussion of the sliding window technique.

Mainly you need to read windows of a size guarantied bigger as the lines you wanna erase.

The windows in between shouldn't cost much if you read and write in bulk instead of line per line.

HTH! =)

Cheers Rolf

( addicted to the Perl Programming Language)