Home » Developer & Programmer » Forms » replace in a text file
replace in a text file [message #155645] Tue, 17 January 2006 15:51 Go to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

Hii all

i have a text file
i want by using 'TEXT_IO' package to search for a word and replace it by another word in that text file

thx
Re: replace in a text file [message #155665 is a reply to message #155645] Tue, 17 January 2006 17:29 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Open the input file, open an output file, read the lines one at a time from the input file, use 'instr' to find the text, if found use 'substr' to replace it, write the line to the output file, at end of file, if no changes made, drop the output file, if changes made, save the output file, drop the input file, and rename the output file to the input file name.

David
Re: replace in a text file [message #155666 is a reply to message #155665] Tue, 17 January 2006 17:31 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Depending on the version of forms that you are using consider using utl_file, and if you want to work on the PC look at webutil.

David
Re: replace in a text file [message #155693 is a reply to message #155645] Wed, 18 January 2006 00:53 Go to previous messageGo to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

Hii all
thx for reply

but i want someone to give me a query

thx
Re: replace in a text file [message #155823 is a reply to message #155693] Wed, 18 January 2006 16:29 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Sorry, I don't understand what you mean by "but i want someone to give me a query". Please either explain what you want or post the question/request that has been asked of you.

David
Previous Topic: key-Enter
Next Topic: Should I bother learning forms??? Arn't they going to die out???
Goto Forum:
  


Current Time: Fri Sep 20 04:25:10 CDT 2024