comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Simple number formatting problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Simple number formatting problem [message #21020 is a reply to message #21016] Wed, 02 August 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Simon de Vet (simon@mathstat.dal.ca) writes:

> Trivial problem, no doubt, but I've never been able to get my brane
> around formatting options.
>
> I have a list of files, with the extension .01, .02, .03 ... .12. The
> preceding portion is indentical in all cases.
>
> I'd like to be able to load these in a loop, but I first need to convert
> the counter value into this format.
>
> My current, and very ugly, technique is to have an array filled with
> ['01', '02', ... '12'], and then reference the appropriate entry. It
> works, but I don't like it.

I'd try something like this:

IDL> base = 'myfile'
IDL> ext = '.dat'
IDL> for j=1,12 do print, base + String(j, Format="(I2.2)") + ext

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: xwindow, idl5.2, win2k
Next Topic: xwindow, idl5.2, win2k

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 08:31:53 PDT 2025

Total time taken to generate the page: 1.04119 seconds