Created
April 11, 2016 05:59
-
-
Save qrilka/15ce862e18fd1d13f58e1677c3f307f3 to your computer and use it in GitHub Desktop.
Revisions
-
qrilka created this gist
Apr 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ {-# LANGUAGE OverloadedStrings #-} import Data.ByteString.Lazy as L hiding (putStrLn) import Codec.Xlsx import Control.Lens import Data.Time.Clock.POSIX (getPOSIXTime) main = do bs <- L.readFile "test.xlsx" let xlsx0 = toXlsx bs value = xlsx0 ^? ixSheet "4_pooli" . ixCell (2,2) . cellValue . _Just ct <- getPOSIXTime putStrLn $ "Cell B2 contains " ++ show value let xlsx = xlsx0 & atSheet "sheet" . _Just . cellValueAt (2,2) ?~ CellText "New text" L.writeFile "example.xlsx" $ fromXlsx ct xlsx