cancel
Showing results for 
Search instead for 
Did you mean: 

user defined functions with (field separator) to be passed

Former Member
0 Kudos

Hi all,

following is my source file -->

UNH000000101ORDERS:D: 96A:UN:EAN008'

I am trying for a UDF which should identify the field separator ( as a variable

my requirement is i want to separate out fields from the input string on the basis of field separator (

ORDERS:D: 96A:UN:EAN008'

i want the output as 4 variables they are ORDERS , D, 96A, EAN008--> these outputs need to be passed to 4 diff fields in target structure.

can u help me in writting this functionality

rgds

chaithanya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

define a udf with one string parameter say input...

input will contain the value : <b>UNH000000101ORDERS:D: 96A:UN:EAN008'</b>

inside the UDF you can then use StringTokenizer class and then using nextToken method for 4 times you can capture the four values in four diff variable.

while creating the tokenizer object u can specify that you need to delimit values based on :

Former Member
0 Kudos

hi amol,

thanks for the response, can you detail me regarding the code which i have to wite & the class for it to import.

can you detail me more on this

any suggestions .....

rgds

chaithanya

Answers (0)