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?
Solved! Go to Solution.
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
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....
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.
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.
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.
User | Count |
---|---|
35 | |
27 | |
7 | |
7 | |
7 |