Path: news.mathworks.com!not-for-mail
From: "M K" <maha_k@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: alternative to laod file?
Date: Tue, 29 Sep 2009 10:36:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 7
Message-ID: <h9snuj$csk$1@fred.mathworks.com>
Reply-To: "M K" <maha_k@mathworks.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254220564 13204 172.30.248.35 (29 Sep 2009 10:36:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 29 Sep 2009 10:36:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1115780
Xref: news.mathworks.com comp.soft-sys.matlab:573618


Hi !

I have a series of large ASCII files which I want to process using Matlab. I do that by loading each file using the 'load(filename)' function. Howeever, I 've noticed that some of the files are incomplete and therefore the number of columns in the last line are not consistent with the rest of the rows in a given file. So what I'd like to do is load the incomplete files to only a certain number of rows (ie to the row number that is complete). 

So for ex if the original file size is : 1000 rows x 1000 columns (the real numbers are much much larger), I want to load the file to 999 rows x 1000 columns since the 1000th row is corrupt. Is there any way I could do this in Matlab. One option would be to open each corrupt ASCII file and delete the last row manually but I have >500 files! So wondered if there was a way of doing this on my script file? 

Any help will be much appreciated.