Closed ooker777 closed 2 years ago
Hi, because you have a space on the second line after the comma, it is reading the rest of the line as three more fields. If you had:
name,value
Alice,a
Bob,"b,c,d"
Then it would end up with:
Bob:: [[b,c,d]]
Unfortunately nesting of lists isn't really possible in CSV file formats, and I'm not sure how easy it would be to implement it locally. It would have to consider quotes within quotes and other special characters that could interrupt the detection of commas within the field.
I find the csv-to-md script work like a charm. Do you think it would be best to recommend using it to other users as well?
I find the csv-to-md script work like a charm. Do you think it would be best to recommend using it to other users as well?
How do you use that script to break up your "b,c,d" single value?
not really (see this issue). But it can make it to
Bob:: [[b]] [[c]] [[d]]
and from there you can use regex to split it into multiple lines
If it is a list, then the handlebars #each can be used to iterate over the list to add some text multiple times. So your template could become:
{{#each value}} {{name}}:: {{this}} {{/each}}
It might be that name needs to be accessed as {{../name}} instead of just {{name}}
See https://handlebarsjs.com/guide/builtin-helpers.html#each
Say my CSV file is:
And my template:
In Alice.md it returns
Alice:: a
as expected. But in Bob.md it returnsBob:: [[ "b]]
. Is it possible to have it return like this?