Forum Discussion

vgupta's avatar
vgupta
New Contributor
5 years ago
Solved

Parsing the string as a csv

Hi, I want to parse my dataset which is coming out as a string. Here is the example of the dataset [“field_name1,field_name2,field_name3,field_name4,field_name5,field_name6,field_name7\nValue1,Va...
  • 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"