We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Using Alteryx to copy pdfs from one folder to another and rename them

rjbrsh
7 - Meteor

Hi, 

I have 2 columns in an excel sheet like so - 

rjbrsh_0-1754605615994.png

I'm trying to copy files listed in 'Chart ID' column from a folder, paste them into another folder and rename each as names in the column 'New Chart ID'.  

I've been trying to achieve this using a formula tool that defines 'cmd' as 

'copy ":C:\source folder\' + [Chart ID] + '.pdf" "C:\destination folder\' + [New Chart ID]+'.pdf"'

and adding a run command , but unfortunately, it hasn't worked.

Any help would be much appreciated. 

7 REPLIES 7
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @rjbrsh ,

 

I don't see a problem in your approach.

Could you provide us more details of the error you get in running the workflow?

Gaurav_Dhama_
12 - Quasar

Use blob tools to do this task. Following will be the sequence of steps.

1. Input tool (text input or directory tool) that will basically get your input files full path.

2. Blob input tool, select a the path of file you want to copy.

3. Add a formula tool that will change the file path that was used to read with the destination path.

4. add blob output tool, and use new file path as replace the full path.

 

this will do exactly what you are trying to achieve.

Raj
16 - Nebula

@rjbrsh can you share the sample workflow? 
as the approach seems correct, and we need to check the reason of failure

Gaurav_Dhama_
12 - Quasar

Try this code

'copy "C:\source folder\' + [Chart ID] + '.pdf" "C:\destination folder\' + [New Chart ID]+'.pdf"'

 

You have an extra ":" after copy command. 

Gaurav_Dhama_
12 - Quasar

However, I would prefer using blob over cmd, cmd is an external application to Alteryx, and there will always be chances of something going wrong. Attached is the workflow that I would recommend for moving the files around.

 

Genevieve
8 - Asteroid

Hi @rjbrsh 

 

There is a really good too that you can download. https://github.com/bobpeers/Alteryx_SDK_FileCopyMove/tree/master

Basically you need to feed it The Source directory, Direction directory and choose whether you want to Copy or Move your file.

 

I now use it whenever I need to move large batches of files. in combination with the Directory tool as it offers me control on which files I want to move.

rjbrsh
7 - Meteor

This approach worked great for me. Appreciate your help!

Labels
Top Solution Authors