Home » SQL & PL/SQL » SQL & PL/SQL » UTL_FILE Remove Line
UTL_FILE Remove Line [message #41628] Fri, 17 January 2003 08:20 Go to next message
Das
Messages: 92
Registered: November 2002
Member
Hello All,
I am using the UTL_FILE for different file operations, I however have a need to remove(delete) lines from the text Files I have read, I see no so method in the UTL_FILE package.
Can someone give me leads on how to do that.
Basically I want to open a file, read a line, and delete it before closing the file.

Thanks much
Das
Re: UTL_FILE Remove Line [message #41629 is a reply to message #41628] Fri, 17 January 2003 08:59 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
true.
there is no delete functionality in utl_file.( i beleive, an enhancement request was placed with 9i..i am not sure)
the workaround is to,
1. read lines (contents) of file ( in a loop)
2. write them in a new file
3. while writing, OMIT / DISCARD the unwanted lines.
4. delete the old file or move the old file in OS.
   else
   you can use pl/sql itself to call the OS commands
   to clean the old files.

UTL_FILE Remove Line [message #41631 is a reply to message #41628] Fri, 17 January 2003 11:22 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
tom has a good method
TOM
Re: UTL_FILE Remove Line [message #41633 is a reply to message #41628] Fri, 17 January 2003 11:57 Go to previous message
Das
Messages: 92
Registered: November 2002
Member
Thanks Guys that was helpful.

Regards
Das
Previous Topic: Question on creating a stored procedure
Next Topic: Execute Immediate
Goto Forum:
  


Current Time: Mon Apr 28 19:23:57 CDT 2025