Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Unzip many zip folders and extract CSV to new directory

trevorwightman
8 - Asteroid

Hello, beginner here:

 

I am looking to take a handful of zip files (all zip files contain a few files but only one CSV file), extract the CSV file and place it in another directory. The CSV should alwasy have the same name as the zip file. So, if I were to start with 10 zip files, I would want to end up with all 10 CSV files in another location. Is anyone able to help me out with this? Please let me know if you need more information or if I need to post this a different way. Thank you!

1 REPLY 1
cplewis90
13 - Pulsar
13 - Pulsar

Hey @trevorwightman,

 

One thing you may want to look at is PowerShell in a Run Command tool. You can use a directory tool to find all zip files and then use the run command tool to find the csv files in the zip. This would ensure if there is ever a change where the zip files change and add more csv files you would be good.

 

To meet your need more quickly, you can use a directory tool to identify all zip files, use a formula to create the csv filename (Replace([Filename], ".zip",".csv") as your formula, and then pass both the full file path of the zip and the filename of the csv to a dynamic input (Alteryx can read files from a zip without unzipping anything). 

 

I have examples of both, just let me know which one you would prefer.

Labels