community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Output files to ZIP

Meteor

Hello,

 

I have an analytic app that is run by our users via our company's Gallery.  The process is that the user uploads an Excel file and the output is 7 CSV files plus a text file.

 

I want the output to just be 1 zip file containing those 7 CSV files and 1 Text file.  I've seen posts that talk about this but I haven't found anything that works- especially not cleanly.

 

Any ideas on how to accomplish this?

 

Thanks.

Alteryx Certified Partner

Keep your process as-is. You need to add to it by adding a run command tool to zip those files up. Create the run command to zip using a formula tool and ensure all of those files are sitting in a temp directory that you can zip and ship to where needed. I would suggest using a block until down tool and the 1st step be the writing of those files, then step 2 is to zip them and send them off using command line (Run Command tool).

Alteryx Certified Partner

Hi @nsmith293,

 

There is a solution to your Question, it definitely will give you the result. once done, you wouldn’t have to do it again and you will get your results.

In order to create zip files, first you need to install 7 zip software. Link: https://www.7-zip.org/

Second Step involves Creation of a Batch file, which we are going to use in Alteryx to create Zip Files.

Batch File: Open Notepad, and write the following codes line by line.

            path c:\Program Files\7-Zip (installed path)

            7z a -tzip “{path where you want to create your zip files. Example: D:\ all_Files.zip}” {space} “{Path where your files are stored}”

Save this notepad at any location by ending *.bat. It will store the file in batch format.

 

image.png

Final step is that in Alteryx go to Developer tab, Drag and drop Run Command, in Run External program (UI), select your batch file, ending with .bat

 

image.png

 

Important Points: Folder location should be different (where you are fetching files and where you are storing zip file) in order to execute this. This program will overwrite existing zip file. Also note that you might have to block until done tool, as this should execute in the last.

I hope this solution will help you out.

Meteor

Thanks for the input on this.  The challenge I have is (1) I need it to run on the server, so any local path references are no good and (2) I need the ability to be dynamic in directory and file name.

 

I'm going to ask my IT team that owns our server, but I was wondering if there was a way anyone knew to do this in a server environment.

 

Thanks.

Alteryx Certified Partner
Alteryx Certified Partner
Can you output to a common network share drive using UNC paths?
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Meteor

Yes, UNC paths work.   I'm just not sure how to call a zip cmd and support dynamic path/filename definitions. 

 

Thanks.

Highlighted
Asteroid

I'm interested to see if anybody can assist on cmd tools on unc paths to use when scheduling on server.

Hey Everyone,

 

I've just submitted the idea to the Alteryx team. Please give it a vote if you think it should be added.

https://community.alteryx.com/t5/Alteryx-Designer-Ideas/Output-to-batched-zip-file-for-csv-pdf-xlsx/...

 

Thank you.

Labels