replace in a text file [message #155645] |
Tue, 17 January 2006 15:51 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
emadbsb
Messages: 334 Registered: May 2005 Location: egypt
|
Senior Member |
![emadbsb](/forum/theme/orafaq/images/yahoo.png)
|
|
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 message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/67467.jpg) |
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 #155823 is a reply to message #155693] |
Wed, 18 January 2006 16:29 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
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
|
|
|