Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
i need to rename an output (csv) file based on a variable that is inside the Job + the current date. An exemple of the output can be "markertId-ddmmyyyy" where markertId is the variable and ddmmyyyy is the date of the day.
Thanks for the help
Thanks for the answer, unfortunately that is the error message that talend displays me (see the attached file)
is this you are looking for ?
@samfantini please share your tFileOutputDelimited settings for the compilation error.
You were talking about "a variable that is inside the Job".
I thought you were talking about a global variable.
If this is not exact, can you clarify this point?
Are you talking about a global variable, a context variable or a field?
Sorry, I was talking about a field within the Job that takes on value. I would like to put that value in the name of the output csv file followed by the date of the day.
in the 2 pictures below i have highlighted in yellow the name of the field and in the other the settings of the toutputdelimited.
the problem for me is what i have to write in the file name field in the output
So you have to iterate over the content to write into the appropriate output file.
The job design should look like this:
tFixedFlowInput is here for the example - it replaces your tFileInputDelimited.
It content is here (just 3 fields for the example):
tFlowToIterate generates 1 global variable per input field (3 in my case).
Just let it with the default options.
tFixedFlowInput generates a flow from the global variables generated at the previous step.
As you can see, each field is completed with the associated global variable.
Then the flow is pushed into the tFileOutputDelimited.
The filename is like this:
"C:/Users/safantin/Desktop/" +
(String)globalMap.get("row79.marketId") + "-" +
TalendDate.formatDate("ddMMyyyy", TalendDate.getCurrentDate()) + ".csv"
Just beware of the "" around each fixed part.
Tick the option "Write after" on the Advanded Settings tab of the tFileOutputDelimited in case of many records with the same value for the marketId field.
That's all.
Perfect, but i don't understand the "inline table", because i have many records in my table.
my records seems like this:
but i have too many records.
so i would like to know how the second tFixedFlowInput works.
Hi samfantini,
As per your comment, are you getting the "markertId" from input data or from any variables like context/global.
Please provide your inputs on this.
Thanks,
Bharath.