Created
April 11, 2016 05:59
-
-
Save qrilka/15ce862e18fd1d13f58e1677c3f307f3 to your computer and use it in GitHub Desktop.
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 characters
{-# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment