I have an input file and I want to make "n" output files using distinct value.
I need n different files based on distinct values in Col1 with "H".
Any help in this direction would be vey helpful.
Solved! Go to Solution.
Here is the main job:
- tFixedFlowInput is here to mimic your input file:
- tJavaRow set the needed context variables (filename and line):
output_row.line = input_row.line; output_row.type = input_row.line.substring(0, 1); context.line = input_row.line; if(output_row.type.equalsIgnoreCase("H")) context.filename = input_row.line.substring(1, 5);
- tFilterRow is here to exclude header lines from result:
- tRunJob call the external job called "writer" (check the option "Transmit whole context" on this component to transmit the context variables "filename" and "line" you to define for both jobs)
Here is the external subjob "writer" :
- tFixedFlowInput is here to convert context variable "line" into a flow (required for the next component):
- tFileOutputDelimited is here to write the flow into the current file (designed by filename context variable (check option "Append" to write at the end of the file):
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?