Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read .ods file #881

Closed
TanguyBarthelemy opened this issue May 16, 2024 · 9 comments
Closed

Can't read .ods file #881

TanguyBarthelemy opened this issue May 16, 2024 · 9 comments
Assignees
Labels
Milestone

Comments

@TanguyBarthelemy
Copy link

Hi,
I have an issue in reading .ods files.
I try to import it as a spreadsheet file:

image

So the file is placed in the providers panel and the sheet are recognised:

image

But that's all, the file is empty and the series are not read (when I click on the small + on the left, the sheet does not unroll with the series):

image

Maybe it's a bug or the .ods format is not accepted?
Is it possible to add a warning or an error in this case to inform the user that his file won't be read?

@charphi
Copy link
Contributor

charphi commented May 16, 2024

Does it work in JD+ v3?
Try to load it in the spreadsheet profiler (Menu>Tools>Spreadsheet Profiler) and check if something is loaded.

@charphi charphi added the bug label May 16, 2024
@charphi charphi self-assigned this May 16, 2024
@TanguyBarthelemy
Copy link
Author

The spreadsheet profiler is able to read my data but not my dates:

image

@TanguyBarthelemy
Copy link
Author

I tried to edit and save my file with Excel (and not LibreOffice) and the file became readable in JDemetra+ 2.2.4

Here I join you the two version of the same file (one saved with Excel and the other with LibreOffice)

world_excel.ods
world_libre_office.ods

@TanguyBarthelemy
Copy link
Author

in V3 the problem remains the same as in V2 except thar we can explore the content of each sheet but the series are not available because the date is not read:

image

@TanguyBarthelemy
Copy link
Author

TanguyBarthelemy commented May 22, 2024

Hi Philippe,

I tested other .ods files created this time by R (from the readODS package).
I join you the two files (named world_R.ods and world_excel_R.ods): world_excel_R.ods and world_R.ods.

For these two, the file contains one sheet named Sheet1 but seems empty in the provider panel:

image

When I put these 2 files in the Spreadsheet Profiler Windows, I can read my dates:

for world_R.ods:

image

for world_excel_R.ods:

image

So as you can see it doesn't depends on the date format because these 2 files have differents date format.

The problem is the same in v3 except that in the providers tab, the series (colnames) appear but when I try to open them, "No data available".

@charphi
Copy link
Contributor

charphi commented May 23, 2024

The R example is a different problem.
The profiler shows that the date cells are in blue, meaning that it is a string type, not a date.
In order to parse these cells, you need to configure the "Data format" option (i.e. yyyy-MM-dd).

@charphi
Copy link
Contributor

charphi commented May 23, 2024

For the world_libre_office.ods file, the problem comes from the underlying library that is unable to handle LocalDate while being able to handle LocalDateTime.

I've created a new issue at nbbrd/spreadsheet4j#470

@TanguyBarthelemy
Copy link
Author

TanguyBarthelemy commented May 29, 2024

Thank you for your answer about the file .ods created with R.

The date column was (as you mentionned) in the text format and effectively needed a configuration of Date format option when importing (in Providers panel) the file.

@charphi
Copy link
Contributor

charphi commented May 30, 2024

The spreadsheet4j issue has been solved and will be integrated in the next bugfix release of JDemetra+ v2.
jdemetra/jdemetra-core#1134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants