Excel .xlsx conversion for robot use

Hi All,

I have an issue where I need to control an .xlsx file content, but the file generated by my application is not a “standard” one.
So it can’t be read directly by ExcelLibrary, python openxyl nor pandas (I know it starts pretty bad) where it encounter a parse error.
I know opening and saving it allow to format it properly and works then, but my concern is to be able to update file format through test execution locally (on Windows), but also in Docker/linux.

Has somebody an idea for this?
Obviously the target is to have the development team improve this and a correct .xlsx, but the related existing tests need this additional control step, and will fail for the moment.

Thanks
Charlie

By not standard I’m assuming you mean not supported file type that the library supports. Would it be possible to use python / pandas to convert it before handling? Quick google suggest with pandas it’s possible but that’s as far as I went.

Hopefully I’ve not misunderstood

Hi,

Yes indeed the RF libraries can’t open it, but as mentioned openxyl and pandas (directly in .py neither).
I assume usual desktop app have some kind of libraries or functions to get over the parsing issues. So I was wondering if someone already had this kind of problem and a workaround :slightly_smiling_face:

Charlie

1 Like

No drama, I’ve had a similar issue where there were drive links for where it’s pull data which I believe are causing it to hang, but I’d be curious to your findings or what others suggest if any :blush:

Yep, I looked into the options for pandas and openxyl, and found some ideas on the web.
I’ll seek and test if modifying some read parameters help with converting it and let you know.

Thanks!
Charlie

Hi,

For those that would help, finally sort out this by using calamine engine:

from python_calamine.pandas import pandas_monkeypatch()

pandas_monkeypatch()
def open_file(file_path,sheet):
    try:
        df = pd.read_excel(file_path, sheet_name=sheet, engine="calamine")

Regards
Charlie

2 Likes