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

回答 (3 件)

Image Analyst
Image Analyst 2016 年 9 月 28 日
There is no body to your post. So you need to read this link
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.

Walter Roberson
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.

naadiya khudabux
naadiya khudabux 2016 年 9 月 28 日
okay thank you

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by