I have been doing some file manipulation via Alteryx and when it became apparent that there wasn't an easy way to create multiple directories if they don't already exist, and to then copy the appropriate files to both an archive destination and the production destination. I wanted to reach out to inquire about a method to do this via the R Tool and not through the use of a .bat file. The reason .bat files via the Run Command won't work is due to security constraints within my environment. Here is what I am attempting to do:
Each Month I receive 2 files from a vendor with a unique naming convention that I can parse through via Alteryx to create the date range of the data within the file and the name of my archive folder.
For these two files, each has a different destination directory, which is an archive folder.
Also, for those same 2 files, I need to rename them to two different names and then MOVE them to a production folder.
I have used RStudio to run the exact code that I need for this to work and it runs smoothly. When I attempt to do this in Alteryx itself, I get errors or I don't get an error and it seems to work but truly doesn't. I read my 2 rows into the R tool as a list and have attempted to use lapply(x, dir.create), which works in RStudio yet not in Alteryx (R Tool). I have also done this not using lapply and via just a dir.create(unlist(x)) and a few other variations that work in RStudio yet not in Alteryx despite accounting for the fact that my input from Alteryx is handled as a list. Any thoughts on how to handle this?