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.
Hi!
I'm learning Talend and i don't know how do that in the tJavaRow...
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):
It works.
Thank you! I'm trying
But I get error -> Error: Could not find or load main class.
Now it's ok.
But i can't choose "type" in the filter... why?
Hi,
I have synchronized tFilter schema with the tJavaRow schema but the field "type" not...
Hi again
I have create the out fields but the job says: