help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

textread issue


From: snaucler
Subject: textread issue
Date: Mon, 10 Jun 2013 10:36:47 -0700 (PDT)

I am using Octave-3.6.4 vs2010.  have recently (last week) installed the I/O
package.

I am trying to read data from a csv file. Below is a snippet of that file I
am currently working with. 

Chan ID,Chann Name,Slope,Offset
R01,Blade 1 Edge,1.234,4.567
R02,Blade 1 Flap,2.345,5.678
R03,Blade 2 Edge,3.456,6.789

 Here is the line of code I am using:
chanName = textread('Cal_Spreadsheet.csv','%s %s %d
%d','delimiter',',','headliner',1)

I get the error:
error: strread: the number of output variables must match that specified by
FORMAT

If I reduce the code down to just:
chanName = textread('Cal_Spreadsheet.csv','%s','delimiter',',')

It appears to do what I would expect (see below), but that is not quite what
I am looking for. The problem seems to occur when I try to add the second
format type. ('%s %s' vs. '%s') I am pretty sure this is just a syntax issue
on my part, but I just can't figure it out. 

[1,1] = Chan ID
[2,1] = Chann Name
[3,1] = Slope
[4,1] = Offset
[5,1] = R01
[6,1] = Blade 1 Edge
[7,1] = 1.234
[8,1] = 4.567
[9,1] = R02
[10,1] = Blade 1 Flap
[11,1] = 2.345
[12,1] = 5.678
[13,1] = R03
[14,1] = Blade 2 Edge
[15,1] = 3.456
[16,1] = 6.789




--
View this message in context: 
http://octave.1599824.n4.nabble.com/textread-issue-tp4653985.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]