Module Text.CSV

Category
general
Author
Michael Hanus
Version
September 2004

Library for reading/writing files in CSV format. Files in CSV (comma separated values) format can be imported and exported by most spreadsheed and database applications.

Exported Functions


writeCSVFile :: String -> [[String]] -> IO ()  Deterministic 

Writes a list of records (where each record is a list of strings) into a file in CSV format.

:: String  the name of the result file (with standard suffix ".csv")
-> [[String]]  the list of rows
-> IO () 

showCSV :: [[String]] -> String  Deterministic 

Shows a list of records (where each record is a list of strings) as a string in CSV format.


readCSVFile :: String -> IO [[String]]  Deterministic 

Reads a file in CSV format and returns the list of records (where each record is a list of strings).

:: String  the name of the result file (with standard suffix ".csv")
-> IO [[String]] 

readCSVFileWithDelims :: String -> String -> IO [[String]]  Deterministic 

Reads a file in CSV format and returns the list of records (where each record is a list of strings).

:: String  the list of characters considered as delimiters
-> String  the name of the result file (with standard suffix ".csv")
-> IO [[String]] 

readCSV :: String -> [[String]]  Deterministic 

Reads a string in CSV format and returns the list of records (where each record is a list of strings).

:: String  the string in CSV format
-> [[String]] 

readCSVWithDelims :: String -> String -> [[String]]  Deterministic 

Reads a string in CSV format and returns the list of records (where each record is a list of strings).

:: String  the list of characters considered as delimiters
-> String  the string in CSV format
-> [[String]]