Alteryx Designer Desktop Discussions

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

Moving files from one directory to another

ahulin
6 - Meteoroid

Is there a way to move files from one directory to another without using the Run Command tool?  I created a workflow that uses it and it runs perfectly but not on our server.

3 REPLIES 3
echuong1
Alteryx Alumni (Retired)

The only other way is to import the data, and then use an output to write it to a different location.

 

To do a straight copy and paste to another location will need the run command. You are probably having issues because your Server is on Safe mode. Your admin can change this.

https://help.alteryx.com/current/server/safe-and-semi-safe-run-modes-blocked-tools-events-and-data-c... 

ahulin
6 - Meteoroid

That's what I figured but I was hoping someone out there had some magic for me.  🙂

 

Thanks!

RR21
5 - Atom

I am doing the following with python developer tool task and it works.

I am using Directory input tool --> dynamic tool --> formula tool-->python tool

(make sure that filename is passed correctly to python tool) 

 

 

Step 1. from ayx import package 

Step 2. from ayx import alteryx 

df=alteryx.read("#1")

Step 3.from ayx import Alteryx

import shutil

FileImportpath='\\\\Directorypath\\Folder1\\Folder2\\...\\'

FileExportpath='\\\\Directorypath\\Folder1\\Folder3\\....\\'

Step 4. filename=df['FileName'].unique()

filename=filename(0)

print(filename)

Step 5.

FileImportPath=FileImportPath+filename+'.txt'

FileExportPath=FileExportPath+filename+'.txt'

print(FileExportPath)

Step 6. FileExportPath=FileExport+filename+'.txt'

Shutil.move(FileImportpath,FileExportpath)

print('move')

Labels