Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pentaho Spoon - Output to multiple files based on field content

Tags:

pentaho

kettle

I have been attempting splitting the results of a pentaho transform into multiple files based on the value of a specific field without any luck.

E.g. a result set containing the following:

SURNAME, FIRSTNAME, COUNTRY

Obama, Barack, USA

Cameron, David, UK

Blair, Tony, UK

Would result in 2 output files being created:

USA.txt - containing Obama's details and UK.txt - containing the other 2 rows

Any pointers would be greatly appreciated.

like image 502
t_barbz Avatar asked Jan 20 '23 16:01

t_barbz


1 Answers

You can construct a field act as output filename based on Country field. Sent the new constructed field as output filenames in "Text File Output" step.

See the flow screenshot below :

enter image description here

You can also download the solution file from here http://pentaho.phi-integration.com/kettle/kettle-files.

Hope this helps...

Dino

like image 164
Dino Avatar answered Mar 05 '23 11:03

Dino