Use csv files as input for templates
Closed this issue · 0 comments
eljeko commented
Eg, given a csv:
AGE, NAME, SURNAME, COMPANY
"22", "Jhon", "Green", "Acme Corp"
"33", "Mary", "Grey", "International ltd"
Something like:
contacts.tpl:
{
"age": {{csv "AGE"}},
"name": "{{csv "NAME"}} {{csv "SURNAME"}}",
"company": "{{csv "COMPANY"}}"
"email": "{{email}}",
"about": "{{lorem 20}}",
"country": "{{country}}"
"address": "{{city}}, {{street}} {{building 2}}, {{zip}}"
}
and running
jr run contacts -n 2 -csv path-to.csv