That's because you slurp the entire file into memory. It's better to step through the file line-by-line. It is more scalable and gives a better performance.
In reply to Re: to delete a set of specific lines in a file
by dHarry
in thread to delete a set of specific lines in a file
by sugar
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |