help-octave
[Top][All Lists]
Advanced

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

Problem using sscanf


From: Fritz Fischer
Subject: Problem using sscanf
Date: Mon, 28 Nov 2011 11:11:19 +0100

Hello,

I am trying to change some MatLab code that reads epw-weather files to work with Octave
and I need to replace the textread() function with sscanf() or fscanf().

But I can't figure out the correct syntax.

The lines that have to be read look like this:

1986,1,1,18,60,A7A7E8A7*0H5H5H5I5I5I5I5A7A7E9E9A7*0F86F9?9?,22.0,20.0,88,89500,399,1414,391,170,110

I tried the following syntax:

sscanf(loc, '%i,%i,%i,%i,%i,%s,%f\n')

This correctly reads the first fife entries:

1986
      1
      1
      3
     60

but the following fields in the array are the ASCII-numbers of the cryptic string part and after this the floating point
numner 22.0, supposed to be read with %f does not show up..

Can someone of you tell me what I am doing wrong?

Kind regards,
Walter




reply via email to

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