Free Trial

Alteryx Designer Desktop Discussions

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

File Copying and Moving

bobpeers
9 - Comet

If you want to move or copy files without using cmd or powershell solutions you can now install this tool made with the Python SDK.

 

AlteryxCategory

 

You can choose to keep the filenames the same but you can also rename them at the same time. It's a yxi package you can download and install from my Github site.

 

Happy moving!

 

https://github.com/bobpeers/Alteryx_SDK_FileCopyMove

38 REPLIES 38
fmvizcaino
17 - Castor
17 - Castor

What a great idea to transform it into a tool!! Thanks for sharing @bobpeers 

sean_bolte_dup_544
8 - Asteroid

Hello Bob -

 

When I utilize your tool, the originating Directory path folder ends up being placed inside the destination path folder, along with the target file that was moved. This is in use with a Directory tool input, and defining the Destination path via a Text tool - which already has a defined target folder name that's been created in that path.

 

PythonMoveSetup.JPG

Text Tool setup - to mimic what is actually already in place in the Directory path:

Destination

\\UNC\Folder-A\Folder-C

 

Prior to File Copy and Move Tool use in Module:

Directory - \\UNC\Folder-A\Folder-B\TargetFile.xlsx

Destination - \\UNC\Folder-A\Folder-C

 

Expected outcome:

Directory - \\UNC\Folder-A\Folder-B

Destination - \\UNC\Folder-A\Folder-C\TargetFile.xlsx

 

Actual outcome w/ File Copy and Move Tool Use in Module:

Directory - \\UNC\Folder-A\All Folders other than B

Destination - \\UNC\Folder-A\Folder-C\Folder-B\TargetFile.xlsx

 

I realize I must be incorporating an incorrect setup - anything stand out on how this has been setup?

 

andrewdatakim
12 - Quasar
12 - Quasar

@bobpeers ,

 

What a great share! I constantly run into people who are looking for this functionality. This is much friendlier than asking user to use Command Line to address the problem.

bobpeers
9 - Comet

Hi Sean,

 

I'm having a hard time recreating what you are seeing. In my own test I have these fields mapped as Source and destination:

 

bobpeers_0-1605509929409.png

 

bobpeers_2-1605510047712.png

 

And after the move operation the images folder is empty and the output folder has the images but not extra folders as in your example:

 

bobpeers_1-1605510023074.png

 

Is your setup like this? Can you show me some of the file paths so I can try to see if there's something else going on?

 

/Bob

 

 

sean_bolte_dup_544
8 - Asteroid

@bobpeers 

My mistake in front of me, plain as day! Bringing in the files to process via the Directory tool, I have Directory in the Source, rather than the FullPath - ugh!

 

The tool is working perfectly with the correct FullPath in the source path option. It was doing just as designed when I had:

Directory

\\UNC\Folder-A\Folder-B\

instead of

FullPath

\\UNC\Folder-A\Folder-B\*.xlsx

 

Sorry for the bother!

 

Now my only trick is performing a rename function on the moved files - my customers want to see a timestamp on when their particular file was processed.

 

bobpeers
9 - Comet

@sean_bolte_dup_544 Good to hear!

 

As the tool says if you use a formula tool to change the destination so it also includes the filename the tool will automatically rename the files for you 🙂

SeanAdams
17 - Castor
17 - Castor

Hey @bobpeers  - this really is super helpful.

I did something similar with creating folders (which is also a common task) - I've put the python below in-case you want it (had to change the extension to .txt for the community to allow the upload)

 

 

 

 
NicolasSz
11 - Bolide

Hi,

 

Thanks a lot this is fantastic ! Exactly what I needed 🙂

 

Regards

JMart2135
8 - Asteroid

@bobpeers First off just wanted to thank you for developing this tool, it was exactly the solution i needed for a recent workflow i was asked to develop. I just ran into an issue however attempting to run my workflow on the server. I had the admin install the tool on the server, however I get the error below when attempting to run it. It does run successfully on my local machine.

 

Error  |  80  |  Error: Unable to resolve plugin Python 'FileCopyMove\FileCopyMoveEngine.py'

 

Should this tool be able to work on the server? I know the server service account has access to our local network share folders as i perform other actions in this main directory with other workflows on the server. Could it possibly simply the location the tool was installed on the server maybe differing from the install location on my local?

 

Thanks for the help!

-Jesse

Labels
Top Solution Authors