cancel
Showing results for 
Search instead for 
Did you mean: 

Zip File Read – pass file name to text field

Regina
New Contributor II

Hello, we have a data coming in a zip file. One of the requirements is to read file name and send it to a text field so it can be loaded in to one of the columns in Oracle table.

For example:

File name is SV_4YEVwN5KjncCtVj.zip

Output result (Oracle table):
image
Below is a pipeline I have:
image
ZipFileRead produces following result.
image
How can I extract “SV_4YEVwN5KjncCtVj” from the "zip-filename": "file:///C:/Users/SVC_SN~1/AppData/Local/Temp/sl_pipe_bdca1c58-dd15-403e-9b86-5b6c38102d1b/SV_4YEVwN5KjncCtVj.zip"
and pass it to a JSON Splitter?
image
Any suggestions would be greatly appreciated.
Thank you!
Regina

8 REPLIES 8

dmiller
Former Employee

zip-filename is the value of the File field within the ZipFile Read, so how is that being populated? Is the value specified there or passed in from the previous Snaps?


Diane Miller

Regina
New Contributor II

The value of the File field passed from the previous Snaps. Here is description of each Snap:
image
image
image
image
image
image
image
image
Thank you!

dmiller
Former Employee

It looks like the value of content-location coming out of the Mapper is the file name minus the path.

If you were to put a Copy after the Mapper, followed by a Mapper to only use content-location (remap to FileName), then join it back at the JSON Splitter.


Diane Miller

Regina
New Contributor II

Thank you, Diane. Unfortunetly, FileName is not coming through after Json Parser and therefore, there is no way to get to it in JSON Splitter.
ZipFile Read produces following output:
image
JSON Parser follows directly after ZipFile Read and outputs only content of the data file itself:
image
Therefore, JSON Path does not have FileName:
image

Any ideas how I can pass FileName from ZipFile Read to JSON Parser and then to JSON Splitter?
Thank you!