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

Not importing when first row contains a 0 in a colum #802

Closed
tm-visitmedia opened this issue Mar 13, 2020 · 5 comments
Closed

Not importing when first row contains a 0 in a colum #802

tm-visitmedia opened this issue Mar 13, 2020 · 5 comments

Comments

@tm-visitmedia
Copy link

When i use ImportExcel with a file that contains a 0 in the last colum the whole column is not imported. I use a file with 3 colums.

  1. Articlenumber
  2. Name of the article
  3. Quantity

When in the first row the quantity is 0 the whole column for quantity is not imported. I found this bug while transforming a xlsx file to csv. The same issue happens when i just import it directly in powershell. Is this a known bug?

@jhoneill
Copy link

It's not a known bug and a quick test failed to repro it.

>import-excel ..\..\WindowsPowerShell\test.xlsx

Articlenumber Name   Quantity
------------- ----   --------
            1 Item A        0
            2 Item B        1

Does your data have column headings. I can imagine an issue if 0 is a column heading (using -not cellvalue to infer "empty" and not finding accepting 0) but if 0 is data it should be OK.

Could you share a sheet which has the problem and the command line you are using ?

@tm-visitmedia
Copy link
Author

sure here is a very simple test and it also does not import the column as explained: mega.nz/#!OF1AxYha!fUPDiNY_I7e1_9dG59rMrKi2MpJh3dwiDaq4wzDghQA

as you mentioned i have no column heading. So the 0 is in the first row and therefore is not imported.

Here is also a Screenshot so you can see what happens at my Powershell: mega.nz/#!WUsihQSa!nEjqr9wK0WKBu1mzRYhUNJnRMX1L5wXvj5RNgoZpKLg

@tm-visitmedia
Copy link
Author

Is there an option to import wihout heading?

@tm-visitmedia
Copy link
Author

Ok i found there is a way to import without headers "‑NoHeader"
when i import without the headers it works well. So no bug and sorry for opening a thread

@jhoneill
Copy link

I'll check it later, but your test file has no column headers, so working with the the -noheader switch will help. Currently it sees "123" , "article", and "0" as column names.
I think we (can't remember if this @dfinke 's code or mine) assume all valid column names convert to Boolean true so "0" or "False" won't be accepted.
Strictly that is a bug, because it would be valid to have columns named 0, 1, 2, etc, and I'll fix that when I get a chance.

@dfinke dfinke closed this as completed in 5ea9b1d Mar 16, 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