-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Read and write spreadsheets from and to CSV files in a lazy way -- -- Read and write spreadsheets from and to files containing comma -- separated values (CSV) in a lazy way. See also the csv package -- http://hackage.haskell.org/package/csv and -- http://www.xoltar.org/languages/haskell.html, -- http://www.xoltar.org/languages/haskell/CSV.hs. Both do not -- parse lazy. Reading from other source than plain Strings could -- be easily added. -- -- If you install this package by -- -- cabal install -fbuildExamples -- -- then an example program is compiled and installed, too. This program -- fills a template text using data from a CSV file. E.g. given a file -- template.txt with content -- --
--   Name: FIRSTNAME SURNAME
--   Born: BIRTH
--   
-- -- and names.csv with content -- --
--   "FIRSTNAME","SURNAME",BIRTH
--   "Georg","Cantor",1845
--   "Haskell","Curry",1900
--   "Ada","Lovelace",1815
--   
-- -- the call -- --
--   csvreplace template.txt <names.csv
--   
-- -- produces the output -- --
--   Name: Georg Cantor
--   Born: 1845
--   Name: Haskell Curry
--   Born: 1900
--   Name: Ada Lovelace
--   Born: 1815
--   
-- -- You may also generate one file per CSV row in the following manner: -- --
--   csvreplace --multifile=FIRSTNAME-SURNAME.txt template.txt <names.csv
--   
-- -- For similar (non-Haskell) programs see cut, csvfix, -- csvtool. @package spreadsheet @version 0.1.3.2 module Data.Spreadsheet -- | A spreadsheet is a list of lines, each line consists of cells, and -- each cell is a string. Ideally, spreadsheets read from a CSV file have -- lines with the same number of cells per line. However, we cannot -- assert this, and thus we parse the lines as they come in. type T = [[String]] -- | fromString qm sep text parses text into a -- spreadsheet, using the quotation character qm and the -- separator character sep. fromString :: Char -> Char -> String -> Exceptional UserMessage T -- | fromString qm sep text parses text into a -- spreadsheet and additionally returns text that follows after CSV -- formatted data. fromStringWithRemainder :: Char -> Char -> String -> Exceptional UserMessage (T, String) -- | This is a quick hack. It does neither handle field nor line separators -- within quoted fields. You must provide well-formed CSV content without -- field and line separators within quotations. Everything else yields an -- error. fromStringSimple :: Char -> Char -> String -> T type UserMessage = String toString :: Char -> Char -> T -> String toStringSimple :: Char -> Char -> T -> String