Hi Talend Folks,
Talend will not add extra zeros at the front, without some specific logic somewhere. Are you sure your target Excel file does not have a column format defined that is showing these extra zeros?
Unless you have specified a format in the schema definition, or somewhere in your job, or your target Excel has a format defined on the column, I don't where this will be coming from.
@RAJ,your excel file might have leading zeros format.
Using a tJavaRow you can do that:
output_row.yourField = input_row.yourField != null && input_row.yourField.length() == 14 ? input_row.yourField :
("00000000000000"+input_row.yourField).substring(("00000000000000"+input_row.yourField).length() - 14);
Here is the result:
Démarrage du job test a 10:02 31/05/2018. [statistics] connecting to socket on port 3847 [statistics] connected 00000004567567 00000004536785 00000004567890 45678905678-01 45675458765-02 [statistics] disconnected Job test terminé à 10:02 31/05/2018. [Code sortie=0]
@RAJ, I read you case too fast and thought you want to add leading zeros.
Then I try to push your sample content to an Excel file (field field defined as String) and it works fine, no leading zeros in the output file.
Watch the recorded webinar!
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.
Test drive Talend's enterprise products.