Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Generating file name without using Run COMMAND TOOL

F675029
6 - Meteoroid

Hi I am working for a file of renaming them including the format in one share drive and transferring them to a different folder  . Is there a way not to use a run command tool? What should be the tool be used in changing sheetname?

7 REPLIES 7
Luke_C
17 - Castor

@F675029 

 

Are these existing files or ones that the workflow is creating? For the former, I think the run-command approach is the only way.

 

If the latter, the approach would depend on what kind of file is being generated. Generally you could use the built-in functionality of the output tool. You can use a formula tool to come up with the file name and configure this section of the output tool settings accordingly. 

 

Luke_C_0-1616527345277.png

 

F675029
6 - Meteoroid

The files are existing in the sharedrive folder. There are various files. 

 

Lets say 

 

ABC_Money

ABC_Cash

ABC_Position

 

Now I want  ABC_Money file to be renamed as ABC and transfer it to Output Folder. Is this possible to use

1. Input Directory

2. Use Contain

 

and I dont know what is next. 

Luke_C
17 - Castor

Got it, as far as I know run command would be your only option. Is there a reason you cannot use this? 

F675029
6 - Meteoroid

I am new to bat script. and been watching videos on  how to make it. 

Luke_C
17 - Castor

@F675029 

 

The rename and move batch scripts are very simple. At the core they are:

 

  1. Rename: ren 'full path of the file you want to rename' 'new file name'
  2. Move: move 'full path of the file(s) you want to move' 'new folder path'

We can use formulas in Alteryx to dynamically update the italicized parts of the above. I mocked up a quick example using your 'ABC_Money' example. You will need to update the directory and formulas to fit your folder structures.

 

You'll see we have the file in a folder structure, and you want to rename it and move it to an output folder:

Luke_C_0-1616541871993.png

 

The below workflow will do this:

Luke_C_1-1616541917943.png

 

End result: File is renamed and moved to the output folder. 

 

Luke_C_2-1616541982203.png

 

Qiu
20 - Arcturus
20 - Arcturus

@Luke_C 
Nice one!😁

F675029
6 - Meteoroid

Thank you Luke.. It worked. 

Labels