I have searched for an answer to this and tried multiple ways and just can't seem to find an easy straightforward solution to a request it seems would be a common occurrence. I have a report that runs and dumps out multiple .csv files into a single folder. I certainly could go the effort of creating a workflow that has each file as an individual input and then combining via the Union tool... they all have the exact same structure and for now, the output is predictable.
My problem is that the file names and the number of files may not always be the same. The structure and .csv file type will not change. With that stated I figure there has to be a way to just pull from the directory and combine it into one file. I've seen a few responses to similar requests but in each case, it seems to me they are overcomplicating the solution or they only answer it using a .xlsx format. The latter is a straightforward solution. There is something about the fact that these are .csv files that seems to complicate this solution.
Does anyone out there have an idea/solution that solves without a complicated macro or do I just need to suffer through the first set up with all the output files in the workflow through the Union?
Solved! Go to Solution.
Hi @twildhart - If your files' schema is truly the same you can use masks "*" - to replace many characters or "?" - to replace one character:
In this case one Input Data tool will read all your csv files from your folder.
@twildhart
There is a classic Macro in this community but I cannot file the thread now.
anyway, I modified it so i can work for CSV also.
and we can also simply use the input tools if your data schema is the same.
The macro that I shared in this post along with the accompanying video will read any set of files regardless of data type, including a mix of data types. Check it out.
Thank you for the response. While I was able to make this work with test data... I couldn't get it to work with my data. I think it is due to my lack of experience with Macros. I will keep it around if I run into a more complex situation like unmatched schema or different file types.
Thank you... this hit the spot. Nice and clean Macro... right-sized for what I needed and my limited experience with Macros. Worked like a charm! Thanks
Sorry, this isn't the solution I meant to accept. I clicked on the wrong one... but thanks for trying to help.