Portability | portable |
---|---|
Stability | experimental |
Maintainer | keithshep@gmail.com |
Safe Haskell | Safe-Inferred |
Functions for reading/writing flat files
- formatTableWithWidths :: String -> [Int] -> [[String]] -> String
- maxTableColumnWidths :: [[String]] -> [Int]
- formatTable :: Format -> [[String]] -> String
- parseTable :: Format -> String -> [[String]]
- data Format = Format String String [String]
- csvFormat :: Format
- tabDelimitedFormat :: Format
- doubleQuote :: Format -> String
Documentation
maxTableColumnWidths :: [[String]] -> [Int]Source
for a table, calculate the max width in characters for each column
formatTable :: Format -> [[String]] -> StringSource
Format the given table (the 2D String array) into a flat-file string using
the given Format
parseTable :: Format -> String -> [[String]]Source
Parse the given text using the given flat file Format
. The result
is a list of list of strings. The strings are fields and the string
lists are rows
Format
allows you to specify different flat-file formats so that you
can use parseTable
for CSV, tab-delimited etc.
doubleQuote :: Format -> StringSource
get a quote escape sequence for the given Format