I have a CSV file with the following style of output:
name, pet
-----------
simon, dog
simon, cat
dave, hamster
dave, pig
mike, mouse
I have used a REFORMAT to create a list of just names, then DEDUP
to create a list of distinct names. I then attempted to compare the master
and slave feeds from this to create the following…
name, pet
------------
simon, “dog,cat”
dave, “hamster,pig”
mike, “mouse”
…but so far I can’t do it.
Has anyone seen a solution to this before?? Is there any built in transforms that I can use to do this or attempt to create a customer jar?
It hasn’t. You need only write TL function addInputRecord() where you remember a new pet (eg. add it to list) and getOutputRecord() function, which fills output field with all stored pets; in clean() function you can clear the list.
I’ve tried the above, but I end up getting a none unique list of pets per each user. So for the last user in the sorted file, their list of pets will contain all pets from all the above users, not just the pets that belong to them.
How can I clear down the list before getObjectRecord processes each name?