Dynamic Input for the ZIP folder files
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello All,
Currently i have a requirement, where all the downloads we are getting in ZIP file and the name of the ZIP file and the File underneath(CSV) are upended with date and time, the prefix name always stays same. when i used Dynamic tool, I have to give in formula the complete file name (Fullpath + Filename.CSV) other wise it's failing to fetch the correct file and it's giving error. So I need help in solving this Puzzle
Solved! Go to Solution.
- Labels:
- Developer
- Dynamic Processing
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
If you could share any sample zip files, so I can develop the workflow, as per your file names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Give the attached macro a try. This is only a portion of the problem, but it's a start.
I had this same issue trying to download campaign files from Bing (Don't judge!)
Here's the steps
- Get the directory listing for where you are storing the zip files
- Grab the path of the file you are looking for.
- Send that path into the attached macro
- The macro will pull out all of the file names inside of the Zip file
- Create a new value using the formula tool ([FilePath]+'|||'+[FilesList])
- File Path is where the Zip resides
- FilesList is what's inside
- be sure to include the '|||'
- Use that new value in the DynamicInput tool
It will look something like this:
Finally, I didn't create the macro, and I can't remember where I found it. It's all based on Python code that you care quickly parse to see what's happening.
Good luck!
--
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
agree with @smoosh - break the problem down into smaller steps, get the directory of files first, then you can extract the ones you want.
The other option is to unzip the files - if you google this, a few folk have used a snippet of Python within Alteryx to unzip and then this becomes much easier to work with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @smoosh @SeanAdams , it worked for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for this, this helped me a few months after the post. Question though, the macro gives me the error "Error: ZIP Metadata Reader (3): Record #11: Tool #8: The field schema for the output "Output8" changed between iterations."
Do you know why this might happen? it works if one file is outputted but since its a directory with multiple files, I get this error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Without seeing the files, I can only guess. But I'm thinking that the files within the Zip archive are different. Something like:
File One
Name, Date, OrderID
FileTwo
Product, Date, OrderID
etc.
Each file has to be the same in order for the process to work. I'd start there.
