How to manipulate single lines in text files without writing the entire file?
显示 更早的评论
Hi all,
I need to manipulate single lines in large (~500 MB) text files within a loop. Since reading, manipulating and writing is too time consuming, I am looking for an easier and faster way to manipulate the files. One option is using MS Excel via the actxserver - function. However Excel is limited to about 1 mio lines, which is too little for my purpose.
Hope somebody can help!
回答(1 个)
per isakson
2015-3-12
0 个投票
If the file has a fixed (and simple) format and "manipulating" doesn't change the size of the file, memmap might be the best way to implement something really fast. See memmap, Map memory for low-level memory read and write operations.
类别
在 帮助中心 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!