Path: news.mathworks.com!not-for-mail
From: "julia " <julia.krohn@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: how to read/import multiple files which have headings
Date: Mon, 9 Jun 2008 13:36:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <g2jbk1$ht2$1@fred.mathworks.com>
Reply-To: "julia " <julia.krohn@gmail.com>
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 1213018561 18338 172.30.248.37 (9 Jun 2008 13:36:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Jun 2008 13:36:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1409540
Xref: news.mathworks.com comp.soft-sys.matlab:472832



Hi, 
I am a beginner when it comes to Matlab and am trying now 
for some time to get my data in the most efficient way into 
matlab for further processing. Its rather a lot of files 
(Test1, Test2 ....) which have some headers and are 
delimited with ; in ASCI format. I was hoping that there is 
some automation possible: 

My input gives me an error with the textread and i dont 
really know how to fix it.  Any help appreciated !
-----------
clear all; close all; 
for k = 1:50
  textfilename = ['Test' num2str(k) '.ASC'];
  fid = fopen(textfilename, 'rt');
  data = textread(fid,'','delimiter',';','headerlines',7);
  savefile=['Test' num2str(k) '.mat'];  
  nrows=size(data,1);
  ncolumns=size(data,2);
  data=data(:,1:ncolumns-1);
  lengte = length(data);
  Time=data(1:lengte,1);
% then come lots of variable & calc etc which are fine 
which I omitted here...
  save(savefile,'Time');
  fclose(fid);
end
--------