may i know any idea below logic.
I have files i want to read file pattern and length of the file pattern dynamically.
I want to read file pattern AAA and length of the pattern is 3.
Note: AAA and 3 read dynamically from file or database. The Pattern and length will change before job start.
I have written code in tjava and routine. PFA code.
You can extract name and extension use the java methode on the object substring(start_indext,lenght). If you know that the file name will contain an underscore and you want to pull anything before that
Context.filepath = CurrentFile.substring(0,StringHandling.INDEX(CurrentFile,"-")).
I think little confusion on requirement i think.
Let's say my file name is: AAA_001_timesatmp.csv
I want to read the file name which file pattern is AAA and length(0,3). Now job is completed.
Before if want to run next time, need to change file pattern and length of file pattern dynamically.
PATTERN:001 and length(4,6).
I want to set this pattern dynamically outside talend jobs and read from values from file/database dynamically.
Please let me know if you need more information.
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.