Wednesday 8 January 2014

tJavaComponent Example in Talend

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.
 

5 comments:

  1. Talend Developer Training| Talend Developer Online ...
    http://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

    ReplyDelete
  2. Talend Developer Online Training
    Introduction
    Talend Environment
    Talend Jobs Designing
    Talend Context Variables
    Talend Metadata Connections
    Talend Server
    Logs & Error Handling
    Practices & Sample Jobs
    Talend Developer Online Training, ONLINE TRAINING – IT SUPPORT – CORPORATE TRAINING http://www.21cssindia.com/courses/talend-online-training-160.html The 21st Century Software Solutions of India offers one of the Largest conglomerations of Software Training, If you’re serious about a career in IT, 21st Century would like to provide you a guidance don’t hesitate to organize a free demo session. For any further information regarding the courses once go through our website Visit: http://www.21cssindia.com | Call Us +917386622889 - +919000444287 - contact@21cssindia.com

    ReplyDelete
  3. Thanks for information,we are providing http://www.keentechnologies.com/sap-crm_technical-online-training.html.For more details visit our website.

    ReplyDelete
  4. Nice 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

    ReplyDelete
  5. I have read your information its very useful topic for me. Thanks for providing information. Hyderabadsys providing online training services
    Informatica Online Training

    ReplyDelete