Last active
August 29, 2015 14:20
-
-
Save draegtun/d47a06a5d11370121539 to your computer and use it in GitHub Desktop.
JSON -> CSV challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rebol [ | |
see: https://gist.github.com/jorin-vogel/2e43ffa981a97bc17259 | |
version: 0.0.3 | |
] | |
import http://reb4.me/r3/altjson | |
json: load-json https://gist.githubusercontent.com/jorin-vogel/7f19ce95a9a842956358/raw/e319340c2f6 | |
file: to-file format/pad [-4 -2 -2] reduce [now/year now/month now/day ".csv"] 0 | |
csv: open/write file | |
write csv join "name,creditcard" newline | |
remove-each rec json [none? rec/creditcard] | |
write/lines csv map-each rec json [ajoin [rec/name "," rec/creditcard]] | |
close csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment