Search code examples
javafile-uploadshtalend

Read file from dynamic file location using talend


I am using Talend Studio for Data Integration v5.3.1.

In that I created a Job for fileDelimited. I have uploaded a CSV file and it is reading the file.

I exported the Job as a Zip file, extracted it, and I run the sh file in Terminal. And it was reading the file and displaying it in the console.

Now I want to read a different file in some other file location. is it possible to read the different file by running the same shell script? If so, where I have to change?


Solution

  • you can do it using context variables, and context load. create configuration file which will have all the required input location path and other details.

    you have different files on different location and you just wanted upload files without file parsing right? if so then

    first create configuration file with two parameters.

    FilePath|FileName
    \\Folderone\|File1.txt
    \\Foldertwo\|File2.txt
    

    create two context variables in context named as FilePath & FileName and then used tContextLoad to load above configuration details to context variable

    used these variables to provide file and path at runtime from configuration.