Re: Help on GET_LINE function from UTL_FILE

From: <garethgadd_at_my-dejanews.com>
Date: Thu, 15 Oct 1998 15:42:22 GMT
Message-ID: <70554v$2j4$1_at_nnrp1.dejanews.com>


In article <6vvinh$gu5$1_at_nnrp1.dejanews.com>,   bsc4071_at_my-dejanews.com wrote:
> Iam using the utl_file built in functions to open an external file and read
> the contents.
>
> To read the file I am using the GET_LINE fucnction. However this function
> reads the line into one variable. My problem is trying to parse the contents
> of the variable into its original separate fields that are of different types
> ie. DATE, INTEGER, CHARACTER.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

You'll need to use the INSTR, SUBSTR etc. string functions that are available to you using something like the TRANSLATE function or ASCII values to evaluate what your current character is, it's not difficult just time consuming to work out all the variations. Simply start at position one in your string and work along it a character at a time, I think that's what you are after, if you could change the format of your file so that each distinct string is delimited by something e.g. '|' or '*' or whatever arbitary character then all you would need to do would be to search for the next occurance of that particular character and you would have the natural divides of your string.

Hope this helps

regards

Gareth

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Oct 15 1998 - 17:42:22 CEST

Original text of this message