Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have an input file and I want to make "n" output files using distinct value.
Eg:
Input File
HZARA 123
L123456HY
L98798676
L54354254
HCUSTO456
L98687687
L64746689
I need n different files based on distinct values in Col1 with "H".
HZARA.txt
L123456HY
L98798676
L54354254
HCUSTO.txt
L98687687
L64746689
Any help in this direction would be vey helpful.
Thank you very much!! You are the best!
I have trying do the same job but i have errors. Could you tell me why please?
¡Now work!
I forget to declare the variables in "Contexts"...
Thank you for all (especially for your patience)
Great!
You're welcome.
Think to select the answer which help you most and mark the question as solved.
Kudos also accepted
If you just want to split the input file based on row count. Then Use tFileOutputDelimited.
Go to Advanced setting and tick (Split output in several files) and you can mention number of row you need in each output file.
Hi TRF,
I have the similar scenario but only the input is different, where the keywords is after the records. How do I achieve the similar output?
Input File
L123456HY
L98798676
L54354254
HZARA 123 <-- the Hxxxx indicator is after the data
L98687687
L64746689
HCUSTO456 <-- the Hxxxx indicator is after the data
Output just like una:
HZARA.txt
L123456HY
L98798676
L54354254
HCUSTO.txt
L98687687
L64746689
Regards,
MC Lee
You should have a look to tMemorizeRows / tJavaFlex to solve your case.
Have a look to the tMemorizeRows documentation which contains an example.
Hi TRF,
I ran across your reply while working on a similar problem. But there is something I don't understand. Your example works as it should, but if instead of using a subjob for the tFileOutputDelimited, you filter directly to the tFileOutputDelimited, then only one .txt file is generated and the file is named ".txt", as if the context.filename is blank.
What is different about putting the output in a subjob vs. after the filter?
Thanks!