tJavaComponent complete referral
https://help.talend.com/display/TalendOpenStudioComponentsReferenceGuide521EN/5.3+tJava
This post is about the excel file name from context variables
Let's say I have a file stored in my system location is : SADAKAR_DEMO_TABLE_1387461868.XLSX
Below java code gives the usage of tJava component
System.out.print(context.filename);
output:
SADAKAR_DEMO_TABLE_1387461868.XLSX
String fileName = context.filename;
fileName.replaceAll("_\\d+.*", "").trim();
System.out.print("\n"+
fileName.substring(0, fileName.lastIndexOf("_"))+"\n"+
fileName.replaceAll("_[0-9]+", "")+"\n"+
fileName.replaceAll("_\\d+.*", ""));
output:
SADAKAR_DEMO_TABLE
SADAKAR_DEMO_TABLE.XLSX
SADAKAR_DEMO_TABLE
System.out.print(context.filepath+context.filename);
output:
\Users\sadakar002\Desktop\myproject\my_folder\my_sub_folder\SADAKAR_DEMO_TABLE.XLSX
Based up the file name you are inputting from context variable it'll display the corresponding results of your java code.
https://help.talend.com/display/TalendOpenStudioComponentsReferenceGuide521EN/5.3+tJava
This post is about the excel file name from context variables
Let's say I have a file stored in my system location is : SADAKAR_DEMO_TABLE_1387461868.XLSX
Below java code gives the usage of tJava component
System.out.print(context.filename);
output:
SADAKAR_DEMO_TABLE_1387461868.XLSX
String fileName = context.filename;
fileName.replaceAll("_\\d+.*", "").trim();
System.out.print("\n"+
fileName.substring(0, fileName.lastIndexOf("_"))+"\n"+
fileName.replaceAll("_[0-9]+", "")+"\n"+
fileName.replaceAll("_\\d+.*", ""));
output:
SADAKAR_DEMO_TABLE
SADAKAR_DEMO_TABLE.XLSX
SADAKAR_DEMO_TABLE
System.out.print(context.filepath+context.filename);
output:
\Users\sadakar002\Desktop\myproject\my_folder\my_sub_folder\SADAKAR_DEMO_TABLE.XLSX
Based up the file name you are inputting from context variable it'll display the corresponding results of your java code.
Talend Developer Training| Talend Developer Online ...
ReplyDeletehttp://www.21cssindia.com/courses/talend-online-training-160.html
ఈ పేజీని అనువదించు
Talend Developer Training, Talend Developer Online Training , Talend Developer corporate Training, Best Talend Developer Training , Expert Talend ...
Course contents, biztalk admin enquiry, .Courses at 21st Century Software Solutions
Talend Online Training -Hyperion Online Training - IBM Unica Online Training -
Siteminder Online Training - SharePoint Online Training - Informatica Online Training
SalesForce Online Training - Many more… | Call Us +917386622889
Visit: http://www.21cssindia.com/courses.html
Thanks for information,we are providing http://www.keentechnologies.com/sap-crm_technical-online-training.html.For more details visit our website.
ReplyDeleteNice post! Talend training enables you to use Talend open studio for data integration for real work as quickly as possible. It explains Talend open studio and its usefulness, it explains Meta data, and it will give you a fare idea about Schema and Aggregation. You will be able to know how to start Trish server, how ETL tool connect to Hadoop. More at Talend Online Training
ReplyDeleteI have read your information its very useful topic for me. Thanks for providing information. Hyderabadsys providing online training services
ReplyDeleteInformatica Online Training