Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
xx_emanis
Contributor
Contributor

Loading a part of CSV file name in to a column

Hi All,

I had a requirement where I need to load 10 CSV files located on a folder to one CSV file and I was able to achieve that.

 

Now the  other thing I was asked today was to create a LOAD_DATE column in the output CSV file and the LOAD_DATE should be based on the date which is a part of the name of the source CSV files.

 

For Instance name of one of the source csv files is All_VM_Cluster_Stats_2018-11-04.

 

When the data from this file is loaded to the target output csv file, LOAD_DATE column should be populated with '2018-11-04'

 

Please explain how to achieve this.

 

Thank You.

Labels (3)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

if filename pattern as describe, it very easy, just use in tMap:

 

as "filename" - use You current filename (for example from tFileList)

StringHandling.RIGHT(((String)globalMap.get("tFileList_1_CURRENT_FILE")).replaceAll(".csv",""),10) 

 

View solution in original post

2 Replies
vapukov
Master II
Master II

if filename pattern as describe, it very easy, just use in tMap:

 

as "filename" - use You current filename (for example from tFileList)

StringHandling.RIGHT(((String)globalMap.get("tFileList_1_CURRENT_FILE")).replaceAll(".csv",""),10) 

 

xx_emanis
Contributor
Contributor
Author

Thank you. I was able to achieve my requirement with the solution you provided.