Alteryx Designer Desktop Discussions

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

Working with files (rename, chance file extension, change location)

mathias_schnoor
11 - Bolide

Hey!

I have a given url in Input Tool and connect the Input tool with a Download Tool.

 

I configure the Download Tool to Output to a File >> Temporary File

 

 

 

ConfigureDownloadTool.PNG

 

As responce a get a Browse Tool a string with a file path

C:\..\AppData\Local\Temp\mytmporaryfile.tmp

 

Can I copy the Tempory File Path to a new location following my election and change his file extension.

 

I want to change the .tmp to a .png extension to display the png file on an Alteryx Workflow!

I that possible in Alterxy?

How?

 

Mathiias

 

20 REPLIES 20
Vizblend
6 - Meteoroid
I'm now able to successfully run the process without errors, however it doesn't seem to be truly invoking the job.

When the batch file is initiated in the command line, output changes occur as expected (renaming files based on contents). When the batch file is initiated from Alteryx, no actual expected changes occur and a "finished running in x seconds" message is received.

Any ideas why performance is differing Alteryx vs. native command line?


KaneG
Alteryx Alumni (Retired)

The only thing that I could put this down to would be that the Batch file is not being called properly in the Run Command tool. Try adding a pause line to the end of your batch file, then when you run the workflow through Alteryx, you will be able to see what happens in cmd. If it doesn't pause, then the batch file is not being called.

 

Kane

Vizblend
6 - Meteoroid
Thanks this worked! If anyone else is changing drives, check the syntax and how the command line is responding to the drive instructions.
DigitalRay
6 - Meteoroid

Slightly different than the discussion topic, but this discussion is what helped me get to the point I am now at...

 

I am interested in using the Run Tool to open PowerTerm and execute a script file. Based on bits and pieces of information I found in this discussion, I was able to get to a point where it opens PowerTerm. The problem I am facing now is how to get it to then execute the script (.psl) file. I tried to include it as part of the Command and seperately as the Command Argument. The first approach results in "Failed to run external program... The system cannot find the file specified. The other pops up a message stating "couldn't open file "filename.psl": No such file or directory".  I can navigate to the Powerterm directory and then run ptw32.exe filename.psl without any problems from the Windows command line. In case you are wondering, I am including the path to the PowerTerm executable when using the Alteryx Run Tool. I am using PowerTerm to automatically process a set of commands that ultimately exports a text file that I want to pick up an process with Alteryx. The only way to export the text file is through a menu system. I do not have direct access to the underlying database. Any help or suggestions you can provide will be greatly appreciated.

DigitalRay
6 - Meteoroid

I managed to stumble upon one approach that works... Instead of trying to run it as a command or command with options, I created a batch file that I execute with the Run Tool. The batch files changes to to correct directory and and then runs the command ptw32.exe filename.psl. 

 

If you happen to be doing something similar, be sure to include "exit-emulator" in your PowerTerm script file. If you don't, Alteryx will assume the process is still running and won't move on to the next step.

tom_montpool
12 - Quasar

The comments about using the Run Command tool provide some useful ideas for configuration. However, unless I'm missing something, the simplest answer to @mathias_schnoor would be to configure the Download tool to output "To a File" and to use the "Filename from a Field" option instead of the "Temporary File" option.

 

To do this, I would add the desired path and name of the output to a TextInput tool and then use Append Fields to add that path to the Input file before the Download tool. Assuming that you named the field in the TextInput "PATH", you can specify the "PATH" field in the "Filename from a Field" dropdown.

cbz
8 - Asteroid

Hi Kane

 

I have downloaded your workflow and I found this is most close to the issue that I need to solve, I have created a process according to your idea in the workflow. What I need is based on the following;

 

1), I have a excel file called "masterKPI" which contains about 10 tabs within it

2), at the beginning of every month I need to manually "SAVE AS" the file into a new location

3), I am trying to reduced down this manual step in the alteryx as I will use it in many other workflow as well

 

so during My process I simply produced 3 part:

1), I found the old "MasterKPI" excel file I need using directory and a macro

2), within the path address directory tool generated, I managed to replace some of the strings so it become a new location path address

3), I am trying to export this "MasterKPI" excel file out with the Run Command tool.

 

BUT it doesnt seems work, I am assuming I missed something that cause it doesnt work.

 

Can you help me with this issue please?

 

I have attached the screenshot of my alteryx work.

 

Thank you for your time.

 

Chunbin

KaneG
Alteryx Alumni (Retired)

Hi @cbz,

 

In your screenshot, it looks like you are trying to execute the actual Spreadsheet rather than a batch file. Ideally, you wouldn't want to bring the spreadsheet in or even affect it, but rather just create a batch file that moves/copies the spreadsheet. So, the batchfile will look similar to the below:

 

move "<File Location><Current Filename>" "<New File Location><NewFileName>"

 

That batchfile will then be executed by the Run Command tool, so the Run Command tool will be configured like the below. Attached is an example of how I would do this, you may have some extra steps in order to pick the exact file that you need.

 

Run_Command_Tool.png

 

Kane

cbz
8 - Asteroid

Hi Kane

 

Thank you for providing the solutions, But I am using a version 10 alteryx cant open the one you created.

 

Would you be able save it in a version 10 one or do a screenshot?

 

Thank you for your time.

 

Chunbin

KaneG
Alteryx Alumni (Retired)

Attached. I haven't checked it in an earlier version though, but should work.

Labels