diff --git a/README.md b/README.md deleted file mode 120000 index 100b938..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -README \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..06852b9 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +guile-csv +========= + +Guile csv reader + +## USAGE + +### install +./configure && make +sudo make install + +### read csv +```scheme +(use-modules (csv csv)) +(define my-csv-reader (make-csv-reader #:\,)) +(call-with-input-file "file.csv" my-csv-reader) +``` + +### csv->xml +```scheme +(call-with-input-file "file.csv" csv->xml) +``` + +and result could be: +```xml + + aaa + 11 + aaa@aaa.com + + + bbb + 12 + bbb@bbb.com + +``` + +### sxml->csv or csv-write to output a csv format file + +```scheme +(call-with-output-file "file.csv" + (lambda (port) + (sxml->csv + '((name age email) ("aaa" "11" "aaa@aaa.com") ("bbb" "12" "bbb@bbb.com")) + port))) +``` + +and file.csv would be: +```csv +name,age,email +aaa,11,aaa@aaa.com +bbb,12,bbb@bbb.com +``` + +Enjoy!