|
Re: Write to a certain line of a file [message #79046 is a reply to message #78964] |
Fri, 20 January 2012 08:52  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 1/20/12 9:26 AM, David Fanning wrote:
> Mark Piper writes:
>
>> Ah, nuts! Yeah, I understand. I guess it's moot anyway because, as David
>> has shown, it's trivial to read/replace/rewrite a text file.
>
> Well, it wasn't as trivial as I might have led you to
> believe yesterday. For some reason, I left the part out
> of my example where I actually wrote the *strings* back
> into the file! So, instead of taking 0.014 seconds to
> write a 10000 line file, it actually took something like
> 0.033 seconds. Still *mostly* trivial. ;-)
Only not trivial if you are doing it a lot, in which case I would cache
the results in memory and only write periodically.
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
|
|
|
Re: Write to a certain line of a file [message #79047 is a reply to message #78964] |
Fri, 20 January 2012 08:26  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mark Piper writes:
> Ah, nuts! Yeah, I understand. I guess it's moot anyway because, as David
> has shown, it's trivial to read/replace/rewrite a text file.
Well, it wasn't as trivial as I might have led you to
believe yesterday. For some reason, I left the part out
of my example where I actually wrote the *strings* back
into the file! So, instead of taking 0.014 seconds to
write a 10000 line file, it actually took something like
0.033 seconds. Still *mostly* trivial. ;-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|