help-octave
[Top][All Lists]
Advanced

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

Re: textread issue


From: PhilipNienhuis
Subject: Re: textread issue
Date: Tue, 11 Jun 2013 06:38:43 -0700 (PDT)

PhilipNienhuis wrote
> 
> snaucler wrote
>> 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)
> "headliner" ?  make that "headerlines" and try again.
> 
> In addition I suspect you might need "whitespace", ""  in the argument
> list as well (not sure).
> 
> BTW your example becomes much more readable if you add a few spaces here
> and there, e.g. between arguments and between function name and parens.
> 
> Philip

You don't need the io package to use textread (and textscan & strread),
these are all in core Octave.

Furthermore, the error message is self-explanatory:

With textread (and strread) you'd need to supply a sufficient nr of output
args. Just one (chanName) won't do, you need something like [a. b, c, d] =
textread (....). The whitespace arg isn't needed.

You can also use textscan() as Markus has outlined - may be easier for you,
it'll only need one output arg.

Philip




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


reply via email to

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