Skip to content

Instantly share code, notes, and snippets.

@seralf
Created April 2, 2014 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seralf/9944409 to your computer and use it in GitHub Desktop.
Save seralf/9944409 to your computer and use it in GitHub Desktop.
Idea on how to render data to CSV from JSON, using mustache syntax: http://mustache.github.io/mustache.5.html
{
"items": [
{"name": "nome", "surname": "cognome", "city": "Rome", "header": true},
{"name": "Mario", "surname": "Rossi", "city": "Rome"},
{"name": "Paperino", "surname": "Paolino", "city": "Paperopoli"}
]
}
{{#header}}
{{foaf:name}};{{foaf:surname}};{{geo:city}}
{{/header}}
{{#items}}
{{name}};{{surname}};{{city}}
{{/items}}
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
nome;cognome;Rome
Mario;Rossi;Rome
Paperino;Paolino;Paperopoli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment