Coder Social home page Coder Social logo

Missing columns bug about xlsx HOT 3 CLOSED

qrilka avatar qrilka commented on August 16, 2024
Missing columns bug

from xlsx.

Comments (3)

qrilka avatar qrilka commented on August 16, 2024

@fegu could you show your GHCi output?
Mine shows 5 columns for both rows:

λ> map (\c -> (Map.!) lx (2,c)) [2..6] -- this is ok
[Cell {_cellStyle = Just 2, _cellValue = Just (CellDouble 42254.0)},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "5504542218")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "SYSTOR VEST AS")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "5504542218")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "SYSTOR VEST AS")}]
λ> map (\c -> (Map.!) lx (5,c)) [2..6] -- column is missing
[Cell {_cellStyle = Just 2, _cellValue = Just (CellDouble 42254.0)},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "5504542218")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "SYSTOR VEST AS")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "41109511")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "EIRIK MAGNUSSEN")}]

from xlsx.

fegu avatar fegu commented on August 16, 2024

Hi, yes, there are 5 columns, but the content I get is wrong. One column is missing and all other data for that row shifted left to fill the void.

> map (\c -> (Map.!) lx (2,c)) [2..6] -- this is ok
[Cell {_cellStyle = Just 2, _cellValue = Just (CellDouble 42254.0)},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "5504542218")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "SYSTOR VEST AS")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "5504542218")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "SYSTOR VEST AS")}]

> map (\c -> (Map.!) lx (5,c)) [2..6]
[Cell {_cellStyle = Just 2, _cellValue = Just (CellDouble 42254.0)},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "5504542218")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "SYSTOR VEST AS")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "EIRIK MAGNUSSEN")},Cell {_cellStyle = Nothing, _cellValue = Just (CellText "Faste priser")}]

Since you get correct results, while I don't, I thought about comparing versions. I am using GHC7.8.4 and xlsx-0.1.1 on Windows. However, it seems this bug is fixed in xlsx-0.1.1.1 as I get the correct (your) result now as well. Before you close the issue, perhaps look into why?

from xlsx.

qrilka avatar qrilka commented on August 16, 2024

Thanks @fegu
It appears that there was a bug with empty shared strings, i.e. your file contains the following entry:

<si><t/></si>

And as rich string support required some refactoring of shared strings parsing code this bug was also fixed as a side effect.

from xlsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.