Alteryx Designer Discussions

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

Zip files

AndrewCrayford
8 - Asteroid

Hi Is there a way, where i can take 2 text file which are static and 2 excel sheets which are going to be built in Alteryx. I was wondering how can i zip the 4 files together using Alteryx before placing the zip file onto an FTP site?

6 REPLIES 6
CharlieS
17 - Castor
17 - Castor

I think the general process should go something like this:

 

- Use Alteryx to save all 4 files in the same folder.

- Use the Run Command tool to execute a batch file that compresses that folder into a zip file.

 

Here's a few articles discussing the use of batch files to zip files/folders:

https://stackoverflow.com/questions/20485419/batch-file-script-to-zip-files

https://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-script-using-only-win...

 

AndrewCrayford
8 - Asteroid

I am trying to set up a run command that runs the 7-zip exe and then run command

 

7z a -tzip file1.xlsx, file2.xlsm

 

But it is coming up with the following error code 

 

Error: Run Command (1): The external program "C:\Program Files (x86)\7-Zip\7z.exe" returned an error code: 7

 

But cant find anything that tells me what the error code is? any ideas?

MarqueeCrew
20 - Arcturus
20 - Arcturus

@AndrewCrayford,

 

It looks like you really want something like:

 

 

7z a -tzip archive.zip file1.xlsx, file2.xlsm

 

Here's a snip of the manual:

 

Adds files to archive.

Examples

7z a -tzip archive.zip subdir\

adds all files and subfolders from folder subdir to archive archive.zip.

7z a -t7z Files.7z *.txt -r

adds all *.txt files from current folder and its subfolders to archive Files.7z.

Switches that can be used with this command

-i (Include)
-m (Method)
-p (Set Password)
-r (Recurse)
-sfx (create SFX)
-si (use StdIn)
-so (use StdOut)
-t (Type of archive)
-u (Update)
-v (Volumes)
-w (Working Dir)
-x (Exclude)

See also

Commands: d (Delete), u (Update)
Switches: -u (Update)

 

http://7zip.bugaco.com/7zip/MANUAL/commands/add.htm

 

Cheers,

Mark

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
SriKoka
7 - Meteor

Can you please share the Alteryx workflow with this zipping functionality? Plus, how is this zipped file outputted to users? 

Hi @AndrewCrayford  @SriKoka 

 

This is a workflow sample to show how this could be achieved. Hope it helps. Cheers!

 

christine_assaad_0-1609802659533.png

 

 

 

SriKoka
7 - Meteor

Thank you @christine_assaad. This is very helpful. 

Labels