Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JSON -> CSV challenge
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
You can’t perform that action at this time.