#66020 - 2002-06-03 11:36 PM
Re: Replace string within a .txt file
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Before writing you a script.. (have you read the manual?).. this is your basic procedure:
1. open the file 2. read a line of the file 3. Check to see if the string is in the line and replace it (using instr and substr) if it is. 4. Open a second temporary file 5. Write the line to the file. 6. Repeat from #2 until the file is finished. 7. Close both files. 8. copy the temporary file over the first file. 9. delete the temporary file.
(I would probably write you a script for this but I don't have time at the moment.. someone else may do this for you! )
Brian [ 03 June 2002, 23:38: Message edited by: BrianTX ]
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 640 anonymous users online.
|
|
|