Home » SQL & PL/SQL » SQL & PL/SQL » geting specified data from a text file using utl_fie
geting specified data from a text file using utl_fie [message #287605] Wed, 12 December 2007 22:04 Go to next message
ridhi_sundar
Messages: 184
Registered: November 2007
Location: Bangalore
Senior Member
I am using utl_file to retrive data from a text file.The text file is as below.

ISA*00* *00* *ZZ*170901T *ZZ*2026422 *071128*1315*U*00300*000000002*0*T
GS*PO*170901T*2026422*071128*1315*2*X*003060
ST*850*00
0000002
BEG*00*NE*00514743**071121**AE
CSH*O


here the * are feild separaters. Suppose i want to retrive the data from the 3rd feild from line starting with BEG . Here it should be 'NE'.

How to retrive it?
Re: geting specified data from a text file using utl_fie [message #287617 is a reply to message #287605] Wed, 12 December 2007 23:30 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I am using utl_file to retrive data from a text file.
Why don't you use External tables, instead of UTL_FILE?
Re: geting specified data from a text file using utl_fie [message #287641 is a reply to message #287605] Thu, 13 December 2007 00:37 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
If you really want to do it the bad way (PL/SQL), you can use INSTR and SUBSR functions.

Regards
Michel
Previous Topic: Need to convert amount in numbers into words
Next Topic: What are the types of index?
Goto Forum:
  


Current Time: Tue Feb 11 03:42:08 CST 2025