MATLAB - Delete elements of binary files without loading entire file
Posted
by Doresoom
on Stack Overflow
See other posts from Stack Overflow
or by Doresoom
Published on 2010-04-05T18:48:27Z
Indexed on
2010/04/05
19:33 UTC
Read the original article
Hit count: 258
This may be a stupid question, but Google and MATLAB documentation have failed me. I have a rather large binary file (>10 GB) that I need to open and delete the last forty million bytes or so. Is there a way to do this without reading the entire file to memory in chunks and printing it out to a new file? It took 6 hours to generate the file, so I'm cringing at the thought of re-reading the whole thing.
EDIT:
The file is 14,440,000,000 bytes in size. I need to chop it to 14,400,000,000.
© Stack Overflow or respective owner