Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: read file with variable column numbers
Date: Thu, 11 Mar 2010 13:24:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <hnaqtn$hft$1@fred.mathworks.com>
References: <54472496-4e59-440d-a4df-28d621127b3e@k5g2000pra.googlegroups.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1268313847 17917 172.30.248.37 (11 Mar 2010 13:24:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 11 Mar 2010 13:24:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:615921

Dear Mike,

You can definitely read it using fgetl in a for loop. Please see

help fgetl

for further details.

Best.




Mike <sulfateion@gmail.com> wrote in message <54472496-4e59-440d-a4df-28d621127b3e@k5g2000pra.googlegroups.com>...
> Hi
> 
> I have a file like :
> 
> s1   3       1.   3.   5.   file1  file2  file3
> s1   2       3.   5.   file1  file2
> s1   4       1.   2.   3.  5.   file1  file2  file3  file4
> 
> the second column decides how many numbers and filenames follows, like
> 3 there are three numbers and three filenames follows.
> I try textscan and importdata, which seems need same columns in each
> rows.
> 
> How to read this file with variable column numbers?
> 
> Mike