This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I need to perform a task DYNAMICALLY on a subset of files from a set of files. I tried using the directory tool and got the entire set of required files from a folder. Any insights on how to now choose a subset of files from the directory tool and use them with the dynamic input tool to perform a set of tasks dynamically (repetitively using different subsets of files each time) ?
If you cannot already filter it from the wildcard option (e.g. *.csv), then I would create a wildcard list in a text input tool, e.g.
I would then use a Find/Replace tool to do find from the directory list any files that match the list in your text input tool. Filter out the results that don't have any matches and you have the files you want. Does that work?
There's a few ways to do this, and the best will depend on how many files you're bringing in and (more importantly) what those files look like. If all your files look the same (i.e. same field names and width etc.) then the Dynamic Input tool alone will do the trick.
If you want to bring in multiple files that look (even slightly) different, then you'll want to put it in a macro, so that it can handle one file at a time. Both examples below and attached:
Of course, a filter is a great & simple way as well! That should really be the first port of call before creating a separate text file as a "master" list. I would suggest Andy's approach if you have a simple list of files to filter, but if the list is quite long, I would start to look at creating a master reference file instead (as I originally suggested).