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.
Or you could go down the road of creating a batch file within Alteryx (relatively easy to do with the Directory and Formula tools) that you could run after its creation (either manually or as an Event you add to the workflow).
A fairly detailed article that was part of a series related to this can be found here.
Using your solution for dumping all files in a common log folder like Boston1.txt,Boston2.txt,Boston3.txt, Dallas1.txt,Dallas2.txt,Dallas3.txt, etc.
Once they are dumped there we need to copy them into production folders in such a way that all Boston file are copied to Boston folder,all Dallas files are copied to Dallas folder, etc. without again reading them.
I figuered step1 but I am still struggling to figure out second step. I would appreciate all your help!
So the Formula tool basically creates line-by-line what goes in the .bat file. Because of how you can build expressions in Alteryx with dynamic data from your data flow, you can make the creation of the .bat file dynamic as well.
Since a Formula tool basically adds fields "horizontally", you then need to get the values you are creating for the .bat file into a line-by-line basis (i.e., "vertically"). That's where the Transpose tool comes into play. It will take the fields and stack them as rows.
The Trim tool is merely to eliminate white space, and depending on how you configure the lines in the Formula tool, you may not need it.
I have attached a workflow that allows for doing this with multiple files. So assuming you have the Boston, Chicago, and Dallas .txt files created in a single directory, this will create a batch file that checks for folders for those three entities and then copy/delete the files from the original location.
Example of Creating Batch file in Alteryx with Multiple Files.yxmd