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

Home » Public Forums » archive » Modify txt file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Modify txt file [message #85039] Wed, 26 June 2013 00:43 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
I've pretty much read text files pretty often, but haven't manage to modify a text file in a fast way...
Here is the thing. Consider a text file like this:
parameter1 = 5
parameter3 = 2
parameter2 = 8
parameter7 = 23

I would like to change a line 3 to:
parameter2 = 9

Is there a quick way to do this? At the moment I'm reading the file and storing it in an string array, modifying the selected string and rewriting the whole file. Alternatively, I could write in parallel to another file and then do renaming. But I thought that there should be a smarter way using OPENU, but this way I insert a line and not substitute it... or?

Regards,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8.2.2 direct graphics output to PDF?
Next Topic: coyote graphics /iso command

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

Current Time: Wed Oct 08 11:27:17 PDT 2025

Total time taken to generate the page: 0.00399 seconds