Reading files using JAVA code

Hi All,

I need some guidance on what nodes to use to read a file. I will be using Java code to read a file in native format. This format is .pp which is an Asta Powerproject file. The java code will be written with the help of the following resource:
https://www.mpxj.org/
I’ve not written the code yet.

There is a possibility of using Python code instead. The output with will be an excel/csv file that will be shipped to Power BI.

What node(s) are required to read this code?

Regards

Hello @lahiru_ten ,

I haven’t tried it yet but you can try Tika Parser Node.

Thanks and let me know if it works or not.

Thanks for your suggestion, the problem with this node is that I cant see the file extension type.

Just be looking at the node, does this not just put out the metadata instead of the content of the file?

Hi @lahiru_ten , do you have details, or at least an idea of what you expect the format of the output to be?

Does the data that you’ll collect from the pp file lend itself to being output as a series of data tables?

I’m assuming it does…

Whilst I generally favour using java because of my own background, if you are thinking of building something within KNIME nodes for this, I’d probably suggest python would be the better option here.

That’s because Java Snippet works at the row level and cannot in itself generate a new table from scratch. There are ways to achieve it, involving building arrays or delimited strings, but it can get messy. Ultimately for Java snippet, it’s table output really relies on having a similar table as input.

In contrast, the Python Script node is fully capable of generating multiple output tables in their entirety and is not dependant on having any particular input table to work with. It would therefore be totally feasible (assuming it makes sense with the Powerproject data files, and also making assumptions about the capabilities of the mpxj resource you mention, with respect to Python), to read a single data file using the library you describe, and have it generate one or more output tables of data.

After that you can process the returned table data with whatever nodes you require, such as Excel Writer.

Are you able to upload a sample/demo pp file (you would probably need to rename the extension, or better still, zip it, so the forum will allow it to be uploaded). I’m not saying I can help, but it may be useful to look at to bounce ideas around.

Appreciate the response takbb,

The format of the out put would be a structured table that contains information such as Task name, start date, end date, baseline information etc. I’ve attached a sample excel spreadsheet that has come straight from ASTA via an export BI feature. As I want some form of automation, I’d like this to be done by KNIME.

Dummy programme data.xlsx (1.5 MB)

The output I believe would be a single excel sheet with all this information.

Unfortunately, I’m unable to attach a zip folder and there is a 4MB limit to files.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.