Read through CSV file uploaded under 'assets' in repository

Hi All,

Is there a way to read through CSV file uploaded under ‘/content/assets’? I want to do it through scheduler job. Please let me know how we can do it. Any example code snippet would be a great help.

Thanks
Rahul

The data will be in a binary property on the asset node. Note that the node structure will be handle->asses set node → asset node. From the asset node you can get the binary property, from which you can get a stream. Then you need to parse that stream.

Hi do you have a code exmaple for this, as I am struggling to understand what you have written and how to get the content out?

Bit more context.

I have a CSV file uploaded as an asset. It is linked to a document.

HippoAssetBean csvFile = (HippoAssetBean)blockDocument.getCsvFile();
HippoResourceBean resource = csvFile.getAsset();
log.info(“Resource File:” + resource.getName() + " has a length of:" + resource.getLength());
returns the length of the file.

However how do I get the input stream from this?

thanks
J

resource.getNode().getProperty("project:property") .getBinary().getStream()

Something like that should work.