Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am generating a file as output :
String output_file="output_file_location/"+"output_file_name_"+TalendDate.getDate(yyyyMMdd_HHmmss);
When I am printing the string output_file, I am getting this: output_file_location/output_file_name_20181112_171343.
But at the output location specified in the tFileOutputDelimited, I am getting the file name as: output_file_name_20181112_1713430.
Why there is an extra 0 at the end? I am not getting this. It is creating the problem when I want the file to be attached to the email I am sending. It is not getting the file due to that extra 0.
Please suggest solutions. Thanks!!
Hi,
Could you please share the component screenshot of the tfileoutputdelimited for further analysis? In your previous message you have not mentioned double quotes in the getDate function. I hope you are using it in below format.
TalendDate.getDate("yyyyMMdd_HHmmss")
Warm Regards,
Nikhil Thampi
Thanks Nikhil for your response!
Yes I am using double quotes as:
TalendDate.getDate("yyyyMMdd_HHmmss")
I have attached the screenshot of tFileOutputDelimited component. I am passing the "logFileName" context parameter from the parent job. In the parent job, I have below code: String logFile=(String)globalMap.get("log_file_location")+jobName+"_ClientName_"+TalendDate.getDate("yyyyMMdd_HHmmss")+".txt";
globalMap.put("log_file", logFile);
Its quite interesting !
I ran the file naming part and I am getting the value in tlogrow correctly.
So, could you please print the value of tlogrow in the tjava immediately after assigning values and check it? Also please verify whether any concatenation operation is happening later.
On a side note,you have mentioned that you are using put command to move the files. Why don't you try the file components of Talend for the same? It will be more easy for the support team to handle once the code reaches production if you are using Talend components as they are graphical in nature. If you are embedding inside a tjava or tjavaflex, they may miss it to notice as time is the most important factor for support activities.
Warm Regards,
Nikhil Thampi