Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Problems with importing large text files
Date: Wed, 17 Dec 2008 11:06:02 +0000 (UTC)
Organization: Pierburg GmbH
Lines: 21
Message-ID: <giameq$pb5$1@fred.mathworks.com>
References: <giajg4$f3t$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229511962 25957 172.30.248.37 (17 Dec 2008 11:06:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Dec 2008 11:06:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872224
Xref: news.mathworks.com comp.soft-sys.matlab:507478


"Sven B?" <sven.boehm@contiautomotive.com> wrote in message <giajg4$f3t$1@fred.mathworks.com>...
> Hi,
> from my PSPICE-simulation I get a text-file with the simulated data.
> The text file is approx. 500MB.
> The data in the file consists of 101 columns and approx. 100000 rows.
> For Matlab it is not possible to import this file via the Import Wizard.
> The first row is normal text, the others should be numbers.
> The first row has no special delimiter. Sometimes there are 2 sometimes 4 blanks as delimiter.
> Each column is the result of a Monte Carlo analysis.
> 
> The Import wizard starts up an then hangs on the point "creating preview".

Seems like the import wizard is overchallenged... but i guess you can go without it. You obviously know everthing about the the file layout, so a textscan (+ fgetl) should do, like

nCol = 101;
fid = fopen('myfile.txt');
firstRowString = fgetl(fid);
data = textscan(fid, repmat('%f',1,nCol),'CollectOutput', true);
fclose(fid)

Maybe you have to adjust for the delimiters in the data section or other details, see the textscan doc. I *assume* you'll get no memory issues in this way.