I am creating a .csv data import project to a postgresql database. and I want to add a new column that takes the name of the folder where the file is being collected, it is possible to do it, and how can I do it.
I am using tFileList to recover the files in the specific folder and save all the files in the same table.
please help me
This is quite an easy requirement to fulfil given you are already using the tFileList. All you need to do is add a tMap component somewhere in the flow after the tFileList. Then add a "folder" column. The folder column, you would simply use to one of these globalMap variables....
thank you, but with
i have the name of file data.
All directory ex: C:\User\Documents\data\info.
i need only the name of folder
Given the example in your last post, would your folder name be "info"? If so, all you need to do is extract "info" from this variable. Some code to do that can be seen below...
String path = "C:\\User\\Documents\\data\\info"; String folder = path.substring(path.lastIndexOf('\\')+1);
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Read about some useful Context Variable ideas