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

For XLSX columns get deleted from the importer due to inconsistent behaviour for empty or nil fields #19

Open
phochste opened this issue Dec 15, 2020 · 3 comments

Comments

@phochste
Copy link
Member

I guess the XLSX imported should have much better column metadata then the other formats and should know which fields are available in the file.

E.g.

A B C
X X
Y Y Y

Will result in

---
A: X
C: X
...
A: Y
C: Y
...
@nics
Copy link
Member

nics commented Dec 15, 2020

That's what the 'fields' attribute is for if there is no header (fields: "A,B,C"), header: 1 should also do the trick if there is a header column.

@phochste
Copy link
Member Author

brol.xlsx
It is a weird behavior:

$ catmandu convert XLSX --header 1 to YAML < brol.xlsx
---
A: X
C: X
...
---
A: Y
B: Y
C: Y
...

whereas

catmandu convert XLSX --header 1 to CSV < brol.xlsx
A,C
X,X
Y,Y

Adding --header=1 doesn't help..one needs to first inspect the xlsx file in a desktop program to discover all the fields and then use it. This is an other behavior than working with CSV files which always seem to know which fields are available in the file.

@nics
Copy link
Member

nics commented Dec 15, 2020

XLSX import works fine, you're expecting the CSV exporter to magically know which columns there are.

@phochste phochste changed the title For XLSX columns get deleted from the importer when the first row doesn't contain data in the field For XLSX columns get deleted from the importer due to inconsistent behaviour for empty or nil fields Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants