Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: writing something in a text file in specific location using utl_file ???

Re: writing something in a text file in specific location using utl_file ???

From: ganesh bora <lalitmohanpadey_at_gmail.com>
Date: 22 Feb 2007 05:30:58 -0800
Message-ID: <1172151058.623689.136610@v33g2000cwv.googlegroups.com>


On Feb 22, 4:44 pm, "hpuxrac" <johnbhur..._at_sbcglobal.net> wrote:
> On Feb 22, 4:48 am, "ganesh bora" <lalitmohanpa..._at_gmail.com> wrote:
>
>
>
>
>
> > Hi all,
> > Actuly I m trying to write someting in a text file in the specified
> > location, which function have to use from utl_file package in order
> > to do this ....???
> > let me clear this actuly what i m trying to do is ..
>
> > like i have one text file and it contains the text like ----
> > hi how r u
>
> > and i want to replace r with are in the same file using the
> > plsql procedure ...
> > to do this which function i have to use ....
>
> > there is one fseek function which i know to change the cursor
> > location ...
>
> > and one more thing can we not open an text file in read&write
> > both modes like in c language in plsql ....
>
> > plz give me some ideas or example
>
> > Thanks to all
>
> What specific problems are you having?
>
> What does your current code look like?
>
> You will probably get more help if you supply something that shows you
> at least did a little work on it before submitting it to cdos.- Hide quoted text -
>
> - Show quoted text -

Actuly i m trying to write a procedure in plsql through which I can replace any string in the text file .... for example ....

      I have a text file named test.txt which contains data like

               hi its just a test.

now i want to replace its with it is after which the file contains something like

             hi it is just a test.

I was able to append the data on the text file , or i can over write it .... but ... if there is any function through which i can write any data to a text file in any position that is specified by me.

to write the data i m using this ...

--code to write data to text file
declare

    f utl_file.file_type;
    s varchar2(200) := 'hi its just a test; begin

    f := utl_file.fopen('READ_LOB_DIR','test.txt','W');     utl_file.put_line(f,s);
    utl_file.fclose(f);
end;

Thanks waiting 4 ur response .... Received on Thu Feb 22 2007 - 07:30:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US