File param with xlsx file and look for specific column

Hi guys,

I am in the midst of creating a pipeline with the aim to upload the excel file but now I have questions whether is it really doable in uploading the excel file and let Jenkins look for specific column in excel file and get it extracted and from that kind of list, is there a way to populate the text/strings and proceed with the stage to upload them to another $params?

For instance, in excel file we only aim to take IP address and name;

Once this ip address and names extracted and readable from Jenkins, these two columns will be pushed to another stages of sending a POST via curl. Is this doable?

Much appreciated with the help. cheers.

The Jenkins core doesn’t know how to parse xlsx files. Searching for “excel” or “xlsx” at did not show anything relevant either.

One way to do this would be to make Jenkins run a command-line program on an agent to extract the data and output it in a format that Jenkins can parse more easily, such as JSON. Maybe a suitable program exists already, or maybe you can write one using a library that supports Excel files. If you’re programming on .NET, Microsoft has published the DocumentFormat.OpenXml package, which claims “Extraction of data from Excel documents” as one of its use scenarios. However, I remember reading that this package can need a lot of memory for large files.

I don’t recommend making Jenkins run a program that controls the Microsoft Excel application itself, as Excel might not work correctly in that scenario and this use might not be covered by your licenses. Considerations for unattended automation of Office in the Microsoft 365 for unattended RPA environment

1 Like

Well, i hv seen someone posted in the forums saying they can parse csv file and make it readable. Does that mean another file extensions technically by right can be read too? The host that i am currently running is unix based.

Is there any documentation that can support your claims saying not recommending Excel and wont work correctly, so then i can conclude this more professionally and bring this up to my superior. Much thanks Kalle.

I posted the Microsoft documentation link above. apparently redirects to the same page. Here’s what it says:

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

Jenkins agents would qualify as unattended components.

The CSV file format is much simpler than XLSX, so it’s easier to write software that reads CSV files. There is a readCSV step available in the Pipeline Utility Steps plugin.

There is probably software available that can convert XLSX to CSV as an unattended operation. The CSV file could then be read into Jenkins, if it isn’t overly large.