Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I wanted to generate a custom header after the creation of a file and not before file creation. How can I achieve this?
Thanks in advance.
After the creation of a file, read the file content as a string using tFileInputRaw, pass it to tJavaRow and store the content string as a global variable, eg:
globalMap.put("content",input_row.content.toString());
In the next subjob, generate a head string on tFixedFlowInput, pass it to tJavaRow and concatenate the header string with the file content string, eg:
output_row.columnName=input_row.columnName+"\r\n"+(String)globalMap.get("content");
Generate a new file using tFileOutputRaw, the job design looks like:
tFileInputRaw--main--tJavaRow
|onsubjobok
tFixedFlowInput--main--tJavaRow--tFileOutputRaw.
Regards
Shong
Hello,
Could you please elaborate your case with an example with input and expected output values?
Best regards
Sabrina
After the creation of a file, read the file content as a string using tFileInputRaw, pass it to tJavaRow and store the content string as a global variable, eg:
globalMap.put("content",input_row.content.toString());
In the next subjob, generate a head string on tFixedFlowInput, pass it to tJavaRow and concatenate the header string with the file content string, eg:
output_row.columnName=input_row.columnName+"\r\n"+(String)globalMap.get("content");
Generate a new file using tFileOutputRaw, the job design looks like:
tFileInputRaw--main--tJavaRow
|onsubjobok
tFixedFlowInput--main--tJavaRow--tFileOutputRaw.
Regards
Shong
Thanks @Shicong Hong It worked.