Re: Creating files [message #81164] |
Thu, 23 August 2012 12:49 |
Jordan Guerra
Messages: 5 Registered: August 2012
|
Junior Member |
|
|
It worked!
Thanks Jimmy.
On Thursday, August 23, 2012 1:55:54 PM UTC-4, jimmylee...@gmail.com wrote:
> On Thursday, August 23, 2012 11:38:51 AM UTC-6, Jordan Guerra wrote:
>
>> Hi,
>
>>
>
>>
>
>>
>
>> I want to create a sequence of files in the form 0001.idlsav, 0002.idlsav ... 4000.idlsav; each one correspond to a different i in a for loop, but I don't know how to convert the interger 1 into a string in the form 0001, for example.
>
>>
>
>> Any ideas?
>
>>
>
>> Thanks!
>
>
>
> Use the format (I4.4) when building your file name string.
|
|
|
Re: Creating files [message #81165 is a reply to message #81164] |
Thu, 23 August 2012 11:10  |
Russell Ryan
Messages: 122 Registered: May 2012
|
Senior Member |
|
|
On Thursday, August 23, 2012 1:38:51 PM UTC-4, Jordan Guerra wrote:
> Hi,
>
>
>
> I want to create a sequence of files in the form 0001.idlsav, 0002.idlsav ... 4000.idlsav; each one correspond to a different i in a for loop, but I don't know how to convert the interger 1 into a string in the form 0001, for example.
>
> Any ideas?
>
> Thanks!
try this:
for i=0.3999 do print,string(i+1,f='(I04)')
-Russell
|
|
|
Re: Creating files [message #81166 is a reply to message #81165] |
Thu, 23 August 2012 10:55  |
Jim Pendleton
Messages: 165 Registered: November 2011
|
Senior Member |
|
|
On Thursday, August 23, 2012 11:38:51 AM UTC-6, Jordan Guerra wrote:
> Hi,
>
>
>
> I want to create a sequence of files in the form 0001.idlsav, 0002.idlsav ... 4000.idlsav; each one correspond to a different i in a for loop, but I don't know how to convert the interger 1 into a string in the form 0001, for example.
>
> Any ideas?
>
> Thanks!
Use the format (I4.4) when building your file name string.
|
|
|