Error using csvread to import massive excel file

1 次查看(过去 30 天)
I am using csvread to open a excel file in segments because the original file is too large to open in excel. I can open the first portion of the file with the following code:
% determine the number of data points
datapoints = 250000;
nc = 54;
% Calculate the range of data removed frome the csv file
r1 = 4;
r2 = ((datapoints*nc)+r1);
c1 = 0;
c2 = 0;
%gather data from csv file
data1 = csvread(file,r1,c1,[r1,c1,r2,c2]);
However when I manipulate the variables to carry on to the next portion of data using the following code:
% determine the number of data points
datapoints = 100000;
nc = 54;
% Calculate the range of data removed frome the csv file
r3 = ((datapoints*nc)+r2);
c1 = 0;
c2 = 0;
%gather data from csv file
data2 = csvread(file,r2,c1,[r2,c1,r3,c2]);
I get the following error:
??? Error using ==> dlmread at 145 Badly formed format string.
Error in ==> csvread at 54 m=dlmread(filename, ',', r, c, rng);
Error in ==> programtest2 at 51 data2 = csvread(file,r3,c1,[r3,c1,r4,c2]);
Is there a way to solve this issue? Thank you
  1 个评论
per isakson
per isakson 2015-11-26
How large is the file? In your last question you mentioned 1GB. A 1GB csv-file shouldn't be a problem with Matlab. Is it pure numeric?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by