Configure Run Command tool to move a file
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a number of files in a directory, some of which I'll process, some of which I won't, but all YXDBs. Once all of the files I want to process have been processed then I want to move them to a different directory (or maybe delete, still TBC). I can do this using the command prompt.
The difficulty I'm having is how to run the command prompt, how to configure the Run Command tool. Apparently it needs either a Write Source or Read Results, I can't think what these could be to run a command in the command prompt.
I'll actually be generating the list of files to move into a list and am comfortable using a macro to alter the Command Arguments to dynamically load the command line details. What I don't know how to do is to get actually get the Run Command configured.
Note I've seen this prior question on a similar note, http://community.alteryx.com/t5/Data-Preparation-Blending/Using-Run-Command-to-Move-files/m-p/8958, but I prefer to do the Run Command mid-workflow and not use the Events if possible.
Frustratingly I'm unable to upload my 19kb screen shot of the current Run Command configuration so to describe I have entered "cmd" in the Command section and the correct arguement in the Command Arguments [Optional] section, which gives the error "Either an Output connection or Input Connection is required"
Solved! Go to Solution.
- Labels:
- Run Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You could pull all of the seperate files into Alteryx and merge them (I assume you mean union them together) using a standard Input tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks Andrew,
Yes, ideally was hoping save a step and not have to do this...
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The >> should output (append) to the same file, as long as it's in the same directory. http://ss64.com/nt/syntax-redirection.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @s_pichaipillai for explaining how batch commands can be made AND ran in a single Run Command tool!
For those of you who came to this post to learn how to DELETE a file with the Alteryx Run Command tool, you can follow the exact same mold that @s_pichaipillai provides here, but change the Command field in the Formula to be: "DEL"+" "+[SourceFile]
I couldn't get the log part to work (the "> "' + [Engine.TempFilePath] + '\MoveCommand.txt"') so that is why I removed it from the above formula. Without any text file being created by the batch file, you will also need to clear the "Read Results [Optional]" configuration option in the Run Command tool.
Once you've made the above 2 modifications, the Run Command Tool should delete the [SourceFile]!
Important Notes:
1) If your [SourceFile] has any spaces in it, you will need to surround it with quotes. AKA use the Formula "DEL"+" "+'"'+[SourceFile]+'"'
2) Make sure you define your strings in the Formula tool to be long enough!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
I have not used the Command Prompt tool before and am struggling to move my input file to another folder after the process completes.
I have attached the workflow - any insight / steps would be very much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You attached some data in a spreadsheet.
My recommendation is to work through this article which explains how to move a file in Alteryx using Run Command.
If any of the steps aren't clear please let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Have you been able to do this as a batch process with multiple files? I have two directories that I reach in and union the directory as 1. I then want to move all files in both directories to one output folder. I want everything to keep its same name just be moved so that the original files are empty. I am getting very stuck with this even though it appears it should be a somewhat easy process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have been trying to configure the Run command but i get below error:
Run Command (14) The field "Cmd3" is too big (1073741823 bytes) for a flat file. The limit is 64K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
i configured my run command exactly as you did but i get error:
Run Command (14) The field "Cmd3" is too big (1073741823 bytes) for a flat file. The limit is 64K.
Any help would be appreciated
