txt-sushi-0.3.0: Spreadsheets are databases!

Database.TxtSushi.IO

Description

The FlatFile module is for reading misc. FlatFile formats like CSV or tab delimited

Synopsis

Documentation

formatTableWithWidths :: [Char] -> [Int] -> [[[Char]]] -> [Char]Source

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

encode the given text field if it contains any special formatting characters

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

data Format Source

Format allows you to specify different flat-file formats so that you can use parseTable for CSV, tab-delimited etc.

Constructors

Format String String String 

Instances

doubleQuote :: Format -> StringSource

get a quote escape sequence for the given Format