File Names in a Folder Data Source
Update- actually I’ve learned that it does know which file the data came from.
But that doesn’t really help us because SC doesn’t expose a variable that tells us this info. So double-drats.
However, if we wanted to be clever, it wouldn’t be that hard to do this.
You’d only have to create a map “pre” script that runs.
You would use a Folder/File class to loop through the files in a directory that will be a new “import from here” directory.
You could then read the contents of each file and determine if you need to integrate it or not. If so, then you make a new file that has the file name as a column and then each data line from the source file.
now write that file into the “Source data” for the map.
loop through each file and write them back into the source data folder.
now when the map runs, the original file name is a column in the source and you can do whatever.
If you would like to submit an answer or comment, please sign in to the eOne portal.