hello everyone... i want to map memory to a file ,which is around 2 gb. can any body let me know how can i do if my file looks like bellow.
2 次查看(过去 30 天)
显示 更早的评论
if true
% code
end
0 个评论
回答(3 个)
Image Analyst
2016-9-28
Also, see memmapfile().
See the release notes for R2016b http://www.mathworks.com/products/working-with-data-matlab/index.html and read the part about big data.
0 个评论
Walter Roberson
2016-9-28
The file you have posted is a .xlsx file. .xlsx files are binary files that are .zip files that store directories and files that have a particular relationship to each other. Inside one of the directories (stored in the zip file) there is a worksheet .xml file, which is a text file. That .xml file has all of the actual data (the rest of the .xlsx is metadata.)
If you were to be able to find the correct point in the .xlsx file, you would be pointing to a section of compressed text; uncompressing that would get you the xml content. The content is variable length, not fixed record -- for example the items for low-numbered rows use fewer characters to store the row numbers than the higher-numbered rows.
memory mapping an .xlsx file is nearly useless. You might have reason to locate the .xml within it, but you might as well use Java methods for that. You might want to parse the .xml, but the fact that you are memory mapped to the proper place in the file is not going to make that significantly easier.
If your actual file is a .xls instead of .xlsx then it would be a binary file with a different structure that is not suitable for poking around in.
If your actual file is a .csv or .txt file equivalent to a .csv file, then it probably does not have the structure to make memory mapping useful: it probably has a different number of characters per record, and memory mapping is really only useful when the fields are fixed size. However, in a text file with variable-length fields, sometimes fseek() can be quite useful.
If your actual file is a text file in which the fields (and lines) are all the same size, then memory mapping might be useful.
Best for efficient memory mapping is a binary file in which every record is the same length and numbers are stored in binary rather than text and strings are allocated a fixed length. Memory mapping can be useful on those kinds of files.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!