read file with variable column numbers

  • Follow


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
0
Reply sulfateion (350) 3/11/2010 5:20:15 AM

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
0
Reply Sadik 3/11/2010 1:24:07 PM


1 Replies
553 Views

(page loaded in 0.049 seconds)

Similiar Articles:













7/24/2012 4:17:53 AM


Reply: