Hi,
I have 2 columns in an excel sheet like so -
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.
Solved! Go to Solution.
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?
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.
@rjbrsh can you share the sample workflow?
as the approach seems correct, and we need to check the reason of failure
Try this code
'copy "C:\source folder\' + [Chart ID] + '.pdf" "C:\destination folder\' + [New Chart ID]+'.pdf"'
You have an extra ":" after copy command.
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.
This approach worked great for me. Appreciate your help!