Search code examples
exceljobstalenddata-integration

Creating folder in Talend after comparing data from File


I have a requirement where I have a excel file, where there are four columns in the file. The image for the columns are attached.

Excel File Structure

I have created a simple job using tsystem componenent which creates folder in a specified directory. The parameter changes for the job is below :

Component Snip

The component is creating the required folders, but the requirement here is I will pass the values for the context variables folder and folder1 at run time, which needs to be mapped with the columns of the excel file i.e folder and folder1, and if it matches the value for the context variable initial_path needs to be provided the value of column Path from the excel.

Note the excel will have multiple rows but only one row would match with my inputs which I pass at runtime, hence each row should be read till the match is found.

How can i design this job.

Thanks in advance for the help.


Solution

  • Thanks to inputs from @garpitmzn, I applied some code and was able to build the required job.

    The job is below :

    enter image description here

    The java code that i aplied is below :

    enter image description here

    and then on the If trigger , I used the below logic:

    context.folder == ((String)globalMap.get("path_dir"))

    The completed my requirement.