Parsing Flat Pip Delimted File

I can’t seem to find the right component to parse out 100’s of lines like the following:

Example:
Donald|Duck|k|M|ABC;DEF;COM|999740201|000399999715|M111232622;11111.0;W09876578

The end result needs to read:
Donald|Duck|k|M|ABC|999740201|000399999715|M111232622
Donald|Duck|k|M|DEF|999740201|000399999715|11111.0
Donald|Duck|k|M|COM|999740201|000399999715|W09876578

Pairing is done off Field 5 & 8.

Thanks for your help

Hi, sharpiedog,

Normalizer is the component you are looking for. Assuming that number of items in field5 is equal to number of items in field8, you can use Normalizer with CTL code like this:

function integer count() {
	return length(split($in.0.Field5,";"));
}

function integer transform(integer idx) {
	$out.0.* = $in.0.*;
	$out.0.Field5 = split($in.0.Field5,";")[idx];
	$out.0.Field8 = split($in.0.Field8,";")[idx];
	return OK;
}

Best regards,

Thank you so much for your reply & help. I will test out the normalizer & post back.

What is the best reference to study how on how make these functions? Is it a certain language like java, php, etc…? I am still new & trying to learn & leverage the CloverETL tool within Initiate.

Thank you,
Andy

Hi Andy,

it is language called CTL2. Documentation is available here: http://doc.cloveretl.com/documentation/ … /ctl2.html

Thank you very much, I really apprecaite it.