Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: alternative to laod file?
Date: Tue, 29 Sep 2009 16:35:19 +0000 (UTC)
Organization: Pierburg GmbH
Lines: 32
Message-ID: <h9td07$em0$1@fred.mathworks.com>
References: <h9snuj$csk$1@fred.mathworks.com> <d9f2404e-9774-4ee2-bda3-472235cc1296@e8g2000yqo.googlegroups.com> <h9sp5u$7sn$1@fred.mathworks.com> <h9sv4p$8dr$1@fred.mathworks.com> <h9t6ot$6vf$1@fred.mathworks.com> <h9tbb6$rma$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254242119 15040 172.30.248.38 (29 Sep 2009 16:35:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 29 Sep 2009 16:35:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872224
Xref: news.mathworks.com comp.soft-sys.matlab:573729


"M K" <maha_k@mathworks.com> wrote in message <h9tbb6$rma$1@fred.mathworks.com>...
> could someone please help. 
> 
> 
> I've tried many things but I can't seem to get any function to do what load does for me. 


A small script that uses txt2mat from the file exchange. txt2mat is not necessarily sensitive to incomplete rows, but it must loop through the file due to your huge memory demand (should be quite quick, though).
Try+vary if you like (i can't test here)


% your parameters
fn = 'c:\myhugefile.txt';
numRow  = 14484;
numCol  = 5557;
rowStep = 1000;

% initializations
D       = zeros(numRow,numCol);  % phew
fp      = 0;
rowStart= 1;

% loop through file
while rowStart <= numRow
    rowEnd = min(rowStart+rowStep-1,numRow);
    [A,ffn,nh,SR,hl,fp] = txt2mat(fn,0,numCol,'%f',...
        'RowRange',[1,rowEnd-rowStart+1],...
        'FilePos',fp, 'ReadMode','block',...
        'InfoLevel',0);
    D(rowStart:rowEnd,:) = A;
    rowStart = rowEnd+1;
end