How to read excel files in chunk?

4 ビュー (過去 30 日間)
Atik Faysal
Atik Faysal 2021 年 2 月 2 日
コメント済み: dpb 2021 年 2 月 2 日
I do not want to load the whole excel file in the environment to save memory. I know in can be done with pandas in python. Any way to implement the same thing in matlab?
  2 件のコメント
Ive J
Ive J 2021 年 2 月 2 日
編集済み: Ive J 2021 年 2 月 2 日
See datastore or similar.
ds = tabularTextDatastore(myBigdata, 'ReadSize', 100); % set desired line num
while hasdata(ds)
chunk = read(ds); % reads only 100 rows of original file
% do something
end
dpb
dpb 2021 年 2 月 2 日
tabularTextDatastore is not available for a spreadsheet; a spreadsheetDatastore is required. Could then partition it into n smaller pieces.
Or, one can simply use the 'Range' row numbers wanted with readtable or readmatrix if is numeric data; readcell it otherwise.

サインインしてコメントする。

回答 (0 件)

カテゴリ

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