[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sscanf
From: |
bertrand roessli |
Subject: |
sscanf |
Date: |
Mon, 4 Apr 2005 06:39:52 -0500 |
Hello,
I cannot find a way to read from a file a line
that contains both numbers and characters (the length of the
line might vary).
e.g.:
if the line reads
ctave:1> a='1 2 dsf sdaf'
a = 1 2 dsf sdaf
then
octave:2> [c,v]=sscanf(a,'%f%10c',"C")
c = 1
v = 2 dsf sda
works but
octave:3> [c,v]=sscanf(a,'%f%100c',"C")
c = 1
v = [](0x0)
and
[c,v]=sscanf(a,'%f%100s',"C")
c = 1
v = 2
Thank for help,
B. Roessli
--
Dr. Bertrand Roessli
Laboratory for Neutron Scattering
ETHZ and Paul Scherrer Institut
CH-5232 Villigen, PSI
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- sscanf,
bertrand roessli <=