PageRenderTime 30ms CodeModel.GetById 22ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/extra/msxml-to-csv/msxml-to-csv.factor

http://github.com/abeaumont/factor
Unknown | 15 lines | 13 code | 2 blank | 0 comment | 0 complexity | c33cea53394ca4320c9d372ce91cb556 MD5 | raw file
 1USING: io io.files sequences xml xml.traversal
 2io.encodings.ascii kernel ;
 3IN: msxml-to-csv
 4
 5: (msxml>csv) ( xml -- table )
 6    "Table" tag-named
 7    "Row" tags-named [
 8        "Cell" tags-named [
 9            "Data" tag-named children>string
10        ] map
11    ] map ;
12
13: msxml>csv ( outfile infile -- )
14    file>xml (msxml>csv) [ "," join ] map
15    swap ascii set-file-lines ;