Module "CSV.curry"

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.

Author: Michael Hanus

Version: September 2004


 Exported names:

Functions:
readCSV | readCSVFile | readCSVFileWithDelims | readCSVWithDelims | showCSV | writeCSVFile


 Summary of 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.
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).
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).
readCSV  :: String -> [[String]]  deterministic 
          Reads a string in CSV format and returns the list of records (where each record is a list of strings).
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).

 Imported modules:

List
Prelude

 Exported datatypes:


 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.

Example call:  (writeCSVFile fname rows)

Parameters:
fname - the name of the result file (with standard suffix ".csv")
rows - the list of rows

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).

Example call:  (readCSVFile fname)

Parameters:
fname - the name of the result file (with standard suffix ".csv")

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).

Example call:  (readCSVFileWithDelims delims fname)

Parameters:
delims - the list of characters considered as delimiters
fname - the name of the result file (with standard suffix ".csv")

readCSV :: String -> [[String]]  deterministic 

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

Example call:  (readCSV str)

Parameters:
str - the string in CSV format

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).

Example call:  (readCSVWithDelims delims str)

Parameters:
delims - the list of characters considered as delimiters
str - the string in CSV format


Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Jun 16 17:08:43 2009