Hello!
This is my first question to the community. Hoping someone can help.
On a daily basis we receive a “new data” xlsx file (always with a different filename) which is saved into a folder called “Raw”.
Once a week or so, we run an Alteryx process which:
The “new data” xlsx files need to be moved from “Raw” to a folder called “Processed” immediately AFTER they’ve been added to Master.xlsx but BEFORE the workflow ends to ensure all the new data files are processed and added to the master once and only once.
I don’t mind if this happens to each file in turn ie
OR if the add/move happen in a lump ie
Does anyone know how (if!) I can achieve this please? I’m a complete Alteryx novice, so although I’ve seen similar questions asked eg…
https://community.alteryx.com/t5/Data-Preparation-Blending/Copying-multiple-text-files-from-one-folder-to-different/td-p/41833
https://community.alteryx.com/t5/Setup-Configuration/Configure-Run-Command-tool-to-move-a-file/m-p/11139#M477
https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Batch-Files-in-Alteryx-Part-2-Moving-Files/ta-p/15665
…I am confused by which technique best suits my needs and how to tweak it.
The data are confidential, but I’ve attached illustrative "Master" and "new data" xlsx files.
Again, thanks so much for your kind help.
Add your command to a .bat file, then reference the file in the workflow event:
I made a folder on my desktop and tested by moving some .csv files. I used the below command:
move C:\Users\KAnderson\Desktop\RAW\*.csv C:\Users\KAnderson\Desktop\RAW\processed\
Open a text editor, paste in your command and save as a .bat file. You can test that it works by double clicking it and seeing that the files move. Once that is done replace the command with your file using the browse button:
In the Event where the command was set to "move c:\tp_temp\raw\* c:\tp_temp\processed" you would need to change things around a little.
The Command value should be "cmd.exe"
The Command Arguments value should be "move c:\tp_temp\raw\* c:\tp_temp\processed"
If you precede the command argument with a /c, the cmd.exe program will carry out the command and then terminate. You can get all the command line switches by typing cmd /? inside the cmd.exe window.
The suggestion to create a batch file is also a good one. Having a batch file is 'evidence' that a process was run.
Woohoo! THANK YOU!!!!
The easiest way to accomplish what you describe below is with a workflow event. Set up the workflow event to execute after run without errors:
The above command grabs every file in the RAW directory and moves them to the processed directory. If you do not want to grab all files you can limit the wildcard. In your case something like c:\files_location\raw\new_file*... finally if you do not want to issue the command via a workflow event you can use the run command tool.
Its always good to keep your work as simple as possible, but if needed you can also archive files as they are processed using batch macros. This method is more complex, but it allows you to dynamically build the move file command and error handling for each individual file.
Thanks so much for the help Kanderson!
This seems like the perfect, elegant solution.
I've used your command line (image pasted below) correctly I believe, but there's an error (also pasted below) saying "...The system cannot find the file specified." so I must be missing something but I can't see where I'm going wrong.
Hope you can help. Thanks in advance.