Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Input Tool -- ZIP option

tom_montpool
12 - Quasar

The article here Inputting-data-from-a-zip-file talks about the new ability to open a file within a ZIP archive.

 

Can I assume that if I want to dynamically open multiple files from inside a ZIP (i.e. the ZIP contains 12 CSVs and I don't want to extract them prior to my workflow) that this would require something like the CReW WildcardXLSX macro from @AdamR_AYX?

5 REPLIES 5
RodL
Alteryx Alumni (Retired)

Interesting question...the thing is that in the new functionality to input from a zip file, it doesn't seem to provide a list of the files anywhere (as it does when opening an Excel file with multiple tabs). And the Directory tool wouldn't do that for a zipped file either.

 

I quickly built a batch macro that basically replaces the first file name with a list of the file names and gets me all of my records, but for that to work you need to have the list of file names (which you can manually create, but it would be nice if that could be dynamically read in...maybe a good "Product Idea" for Community? Smiley Wink)

 

As a note, it looks like when you select a zipped file in the Input Data tool, it will automatically check the Cache Data setting, so for the macro to work, you would need to uncheck that within the macro. (And if the schema changes between files, you would need to change the Output Mode as well.)

tom_montpool
12 - Quasar

I have used the 'list' function in the 7zip command line through the Run Command tool to generate the list of files inside the ZIP archive...but I'm terrible with macros.

RodL
Alteryx Alumni (Retired)

@tom_montpool,

Try the attached. It works on my system (with the assumption that the 7z.exe file is in the default "C:\Program Files\7-Zip\7z.exe" location). And I think I've included all of the necessary files. Smiley Wink

 

How I got the list of just the file names from the zip file may be a bit hokey and could possibly be improved, but it seems to work.

 

It is basically two macros...one that uses the Run Command (per your suggestion) to get the list (after some parsing of the output from 7z), which feeds into a batch macro that runs through each file name and then outputs (note...regardless of the column names included).

TashaA
Alteryx Alumni (Retired)
LukaGawe
5 - Atom

Hello,

 

I'd need your support in this topic. I have to import over 200 files from a .zip file and it works perfect. But for my workflow I need to assign original File Name (as ID) to each data row. I just need an information, from which original file was the data imported (the name of ZIP file is obviously not enough).

 

Thanks in advance,

Lukas

Labels