Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Getting an extra 0 at the end of Talend datetime

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!!

Labels (2)
3 Replies
Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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);

 


Capture.PNG
Anonymous
Not applicable
Author

Its quite interesting !

 

I ran the file naming part and I am getting the value in tlogrow correctly.

0683p000009M0D9.png

 

 

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