Forum Discussion

heidi_andrew's avatar
heidi_andrew
Contributor
2 years ago
Solved

unzip file reader

The zip file reader snap wont read my zip file with many files in it. Is there a limitation that you can only unzip a file with one file in it?
  • koryknick's avatar
    2 years ago

    heidi_andrew - Depending on the file contents in the zipfile, if you are using the ZipFile Read snap, it sends each file to the next snap as a binary document.  For example, if the files are all the same CSV layout, you can simply place a CSV Parser after the ZipFile Read snap and it will process all incoming files as a consistent stream.  

    Or if the zipfile is an archive of different files, you can use the Binary Router and inspect the "content-location" element which is the filename and send the streams to the appropriate parser for further processing.

    Use "Validate Pipeline" to inspect the Zipfile Read output to get a better understanding of what the snap is doing.

    Hope this helps!

  • heidi_andrew's avatar
    2 years ago

    Here is the syntax I had to use inside the binary router:

    $.get('content-location')=="blahblahfile.txt"