Four Stars

I have an input file and I want to make "n" output files using distinct value.

Input File

HZARA 123

L123456HY

L98798676

L54354254

HCUSTO456

L98687687

L64746689

 

I need n different files based on distinct values in Col1 with "H".

 Output

HZARA.txt

L123456HY

L98798676

L54354254

 

HCUSTO.txt

L98687687

L64746689

1 REPLY
Eleven Stars

Re: I have an input file and I want to make "n" output files using distinct value.

There are two ways I can think of to achieve this. One has been written up on here by @TRF and is a nice approach (https://community.talend.com/t5/Design-and-Development/Split-a-input-file-into-multiple-output-files...). The other is a method I have used which is essentially very much the same as the first, but uses bespoke Java to achieve the same ends (https://www.rilhia.com/tutorials/load-data-dynamic-number-files). 

 

I believe both would be apporopriate, it depends on your use case and what you are comfortable with

Rilhia Solutions