Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have been tasked to perform ETL on a data set that has 10 CSV files with the same information, its just from different countries.
My Question is, how would you populate an extra column in your Dimension table with the name of the CSV file.
Thank You
Hi Shriya,
Please refer below similar solution to add file name for record.
tMap Setting:
Add below global Variable of tFileList to get the current file name
tMap Setting
Kindly let me know whether it answers your question or not.
Thank You,
Sonali Jagtap
I have different CSV files with their name being different countries, i am using a tfilelist and them connecting tat to a tFileInputDelimited them mapping to my dimensinon table, where i want to create a new row titles country and populate it with the csv file name, e.g. Canada.csv to a column where all the records belonging to the Canada table had Canada in that column.
Hi Shriya,
Please refer below similar solution to add file name for record.
tMap Setting:
Add below global Variable of tFileList to get the current file name
tMap Setting
Kindly let me know whether it answers your question or not.
Thank You,
Sonali Jagtap
Hi
I did that but I am outputting to a tMsSqlOutput, it is populating the row with a null.
This is the error I am Getting.
I used ((String)globalMap.get("tFileList_1_CURRENT_FILE")) and the error, how ever when i used
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) it did output the file name.
thats correct
current_filepath should be used in tfileinput component as it has absolute filename including path.below link will help.
https://help.talend.com/reader/mjoDghHoMPI0yuyZ83a13Q/s88XQGiwRClewQ1MPT6I2A
however to get only file name , you could use current_file globalvar.
Thanks for the help.
I'm fairly new to Talend can you please explain how i would use current_file globalvar to give the column name just the file name and not the path.