qrilka / xlsx

Simple and incomplete Excel file parser/writer
MIT License
130 stars 64 forks source link

Invalid zip archive error when opening xlsx file #65

Closed kvanbere closed 8 years ago

kvanbere commented 8 years ago

Error

CallStack (from HasCallStack):
  error, called at src/Codec/Xlsx/Parser.hs:51:18 in xlsx-0.2.4-9SiA9fpnKskAS2JNdYtqrA:Codec.Xlsx.Parser

Link to file http://fsaeonline.com/content/tblMaterials_2015.xls

Code

{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}

module Main where

import           Control.Lens
import           Codec.Xlsx
import qualified Data.ByteString.Lazy as L

main :: IO ()
main = do
    bs <- L.readFile "tblMaterials_2015.xls"
    let value = toXlsx bs ^? ixSheet "List1" .
              ixCell (3,2) . cellValue . _Just
    putStrLn $ "Cell B3 contains " ++ show value
qrilka commented 8 years ago

Thanks for the report, I'll check it out later today, did you try version 0.3.0?

qrilka commented 8 years ago

@kvanberendonck I have missed the obvious thing - that's an XLS file and the library is about XLSX file format only

kvanbere commented 8 years ago

Ah sorry mate