News for hackers. Stuff that matters.
Re:Remove first 300M lines from 700 GB file on 1TB disk by svachalek on Tuesday September 22, 2020 @06:54PM (#24560965)
I like this but there's a trick: reversing in blocks makes the last 300M "lines" not exactly the same as the first 300M lines of the source file.

But the basic idea still works: You could read the original file forward to find the index of the 300M'th line, and then just halt the stack reversing bit when you get there. Delete the whole original file and then stack it back.

There are no comments on this comment yet.