question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing sheets with empty cell data, result in mismatch of table heading and data

See original GitHub issue

Here is an exampel of the issue, imagine this is the excel file:

A1 B1 C1
Field 1 Field 2 Field 3
1 3

I parse the file as a following:

const workbook = XLSX.read(fileStream, {
        type: 'buffer',
        sheetStubs: true
    });
const reuslt = XLSX.utils
               .sheet_to_json(book.Sheets[book.SheetNames[0]], { defval: '' })
               .pop();

What i get as a result is the following

{
    "Field 1": "1",
    "Field 2": "3",
    "Field 3": ""
}

Any idea on how this can be fixed? The browser examples have the same issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DanielTerblcommented, Nov 3, 2020

Have the same issue.

0reactions
reviewhercommented, Feb 11, 2022

Please share a sample file, what you expect to happen and what is actually happening

Read more comments on GitHub >

github_iconTop Results From Across the Web

Formula Parse Errors In Google Sheets And How To Fix Them
This formula parse error happens when a number is divided by zero, which can occur when you have a zero or a blank...
Read more >
How do I fix the "Missing column headers" error message?
1 Open the import file in Excel. · 2 Select everything (Ctrl + A). · 3 In the Cells group under the Home...
Read more >
How to compare data in two Google sheets or columns - Ablebits
Learn different ways of comparing data in two Google sheets or columns and identifying duplicate and unique records.
Read more >
DateTime format mismatch on importing from Excel Sheet
When linking Excel spreadsheets in MS Access, a problem arises when a column has mixed data types. For example, ...
Read more >
Data Import error message reference - Analytics Help
Message Meaning So... Empty column header at column number X. The upload file is missing a column header. Ed... Multiple errors occurred: List of multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found