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

Re: Format strings with comma separated lists



In article <3736bb88.14638556@146.80.9.44>, philaldis@geocities.com wrote:

> I hoping that  someone else understands format strings better than I
> do, because I can't get them to work at all. I was wondering if anyone
> knew how to read a comma delimited list using format strings, such as
> 
> Readf, lun, variable, FORMAT='(n(F6.6, :, ","))'
> 
> ...this is the way I would think that you should do it but this just
> tells me that end of input record encountered.
> 
> Does anyone know how to do it?#
> 
> Cheers, 
> Phil Aldis

    Phil -

    I believe this takes someone old enough to have learned programming
first in FORTRAN....

    For formatted reads, you basically want to include only variable
descriptors and spaces (nX), so the colon and "," are counterproductive.

    Have you tried something of the form:

IDL> READF, lun, variable, FORMAT = '$(n(f6.6, 2x))

    That is, you just want to skip the commas and read the floating-point
variables.

    Hope this is what you're looking for.

                  Joe Gurman

-- 
Joseph B. Gurman / NASA Goddard Space Flight Center / Solar Physics Branch /
Greenbelt MD 20771 / work: gurman@gsfc.nasa.gov /other: gurman@ari.net

Government employees are still not allowed to hold opinions while at work,
so any opinions expressed herein must be someone else's.