Update README

modify the markdown format
master
Mu Lei 13 years ago
parent f57f6de2b5
commit 3132e1ca98

@ -10,14 +10,17 @@ Guile csv reader
sudo make install
* read csv
```scheme
(use-modules (csv))
(define my-csv-reader (make-csv-reader #:\,))
(call-with-input-file "file.csv" my-csv-reader)
```
* csv->xml
(call-with-input-file "file.xml" csv->xml)
and file.xml could be:
```xml
<record-0>
<name>aaa</name>
<age>11</age>
@ -28,8 +31,10 @@ and file.xml could be:
<age>12</age>
<email>bbb@bbb.com</email>
</record-1>
```
* sxml->csv or csv-write to output a csv format file
```scheme
(call-with-output-file "file.csv"
(lambda (port)
(sxml->csv
@ -37,9 +42,9 @@ and file.xml could be:
port)))
and file.csv would be:
```csv
name,age,email
aaa,11,aaa@aaa.com
bbb,12,bbb@bbb.com
```
Enjoy!

Loading…
Cancel
Save