I am getting error,while Loading abc.csv file of 16567kb size,as Out of memory, I have Intel core2duo,3 ghz,3GB RAM,,please help me,, I want to convert .csv file to .mat file by loading it in workspace

댓글 수: 5

per isakson
per isakson 2014년 6월 12일
Some questions:
  • which OS, Windows7?
  • which Matlab release?
  • are other programs running?
  • size of swap file?
  • what function do you use to "load" the file?
What does
memory
return?
.
Image Analyst
Image Analyst 2014년 6월 12일
That's a pretty small file. Your computer, even with only 3 GB of memory should be able to handle a 16 MB file I would think. Can you paste the full error message here (all the red text)?
Arun Badigannavar
Arun Badigannavar 2014년 6월 13일
Sorry,file size is 22205kb
Arun Badigannavar
Arun Badigannavar 2014년 6월 13일
Windows7,2010a ReleaseMATLAB,other programs running,csvread,xlsread,,nothing is working
Arun Badigannavar
Arun Badigannavar 2014년 6월 13일
??? Error: Not enough storage is available to complete this operation.
Error in ==> xlsread at 316 rawData = DataRange.Value

댓글을 달려면 로그인하십시오.

답변 (1개)

C.J. Harris
C.J. Harris 2014년 6월 13일
편집: C.J. Harris 2014년 6월 13일

0 개 추천

For large CSV files you are less likely to run into memory issues if you read it line by line, for example:
nFile = 'file.csv';
[fid, message] = fopen(nFile,'r');
i=1;
numlines = str2double(perl('Countlines.pl', nFile));
while 1
tline = fgetl(fid);
if ~ischar(tline), break, end
comma = findstr(tline,',');
if i == 1
numComma = length(comma);
body_data = cell(numlines, numComma+1); % pre-allocate
end
body_data{i,1} = tline(1:comma(1)-1);
body_data{i,numComma+1} = tline(comma(end)+1:end);
for nData = 1:numComma-1
body_data{i,nData+1} = tline(comma(nData)+1:comma(nData+1)-1);
end
i = i + 1;
end
fclose(fid);
Where the perl script simply contains:
while(<>){};
print $.,"\n",

카테고리

도움말 센터File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

제품

태그

질문:

2014년 6월 12일

편집:

2014년 6월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by