Skip to main content
Question

How to zip a CSV-File inside an attribute?

  • April 3, 2020
  • 1 reply
  • 37 views

My duty is to read multiple CSV-Files my means of HTTPCaller from an online source into an attribute each, subsequently zip the CSV-file inside the very attributes, and finally write the binary attribute content (zipped CSV) to a PostgreSQL bytea-Attribute.

I know how to read the HTTP source and write into the bytea destination attribute.

QUESTION: How am I to zip a CSV-file inside a binary BLOB FeatureType attribute within the FME Desktop Workspace.

Hint: I tried to use the ZipArchiver, but that one needs a file as source, as well as destination, but wouldn't work on attributes.

 

Many thanks for any effort!

1 reply

david_r
Celebrity
  • April 3, 2020

It's not exactly what you asked for, but hopefully it can give you some ideas: https://knowledge.safe.com/questions/82001/how-to-convert-csv-data-in-a-single-attribute-to-a.html

Basically, either use the TempPathnameCreator + AttributeFileWriter to write the CSV contents to file before zipping it with the ZipArchiver and reading it back with the AttributeFileReader, or using Python to do the same thing in-place.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings