I have a scenario to remove the first line of the file (large file around 70 GB) using seek in Python. Also I can't write the data to another file. I need to remove from the existing file only. Is there any solution.
Tried seek to move the pointer to end of the line but not sure how to remove it.
It's impossible unfortunately to delete it instantly, but uou can try this code. This will basically rewrite the content in the same file except for the first line:
The
inplace=Trueargument tells Python to modify the file in place, rather than creating a new file.