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

How to read a .txt file within a .zip file downloaded into temp folder using Download tool

amitupadhyay
8 - Asteroid

Hello everyone, 

 

I am new to Alteryx. I wanted to read weather data which comes as a .zip file and it contains a .txt file within with , delimiter. I used text input tool to provide the URL to Download tool and saved the downloaded .zip file as a temporary file .tmp. How to proceed further to extract the .zip (.tmp) file and read the contents of .txt file?screenshot.PNG

 

 

5 REPLIES 5
danilang
19 - Altair
19 - Altair

Hi @amitupadhyay 

 

If the name of the txt file doesn't change, you can pass the zip file path to a Dynamic Input tool and configure it the way you would a standard Input.   If the name of the file inside the zip file changes you'll need to use a technique similar to the one found here that uses a Python tool to read the names of the files contained in the zip archive.

 

Dan 

mbarone
16 - Nebula
16 - Nebula

Hi @amitupadhyay ,

With the dynamic input tool, you can feed it the full path of the zip file's location.  In the configuration,  you actually set it up to read in a same-structured file as a template.  Makes most sense here to use the text file in the zip folder for the template.

 

Lots of great info on how to use it here:  https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Dynamic-Input/ta-p/249....

 

 

mceleavey
17 - Castor
17 - Castor

Hi @amitupadhyay ,

 

I've built a little macro that allows the input to be handled by the standard input tool. You can pass the filepath in as a dynamic value and it'll output as a text file.

I have just let it read in without a delimiter, but you can change that in the input tool in the macro to suit your needs.

Hope this helps.

 

M.



Bulien

amitupadhyay
8 - Asteroid

Thank you. I was saving as temp file was causing problems may be! When I passed in  a file name and saved the zip file locally. And using the zip tool worked.

 

 

amitupadhyay
8 - Asteroid

Thank you for the link to study the dynamic input tool in detail. I really appreciate it. 

 

Actually the problem was may be because of saving the data from download tool into a temp file which gives an  extension on .tmp even though the actual file is .zip, that is why may be the dynamic input tool was showing me error that it can not find the file. I had specified the template as %.zip in dynamic input tool because %.tmp template was non recognizable by the dynamic input tool. 

 

I have found the solution eventually from the reply sent by 'mcleavy'.

 

Thank you.

Labels