Hi Mark,

I don't believe Eric's #CreateTiddlersFromCSV has been implemented in TW5.

My working solution is to three-step it: (1) Create CSV (2) Convert CSV to 
JSON (best tool: http://www.convertcsv.com/csv-to-json.htm) (3) import 
JSON. It's reasonably fast and relatively painless. 

A few tips:

(1) Create CSV. 

(a) If you are using a spreadsheet, make sure you have a column called 
"title" (lower case, as all field names must be). All other columns become 
fields in tiddlers, including text, tags, etc.

(b)  In spreadsheets, I have build complex formulas that generate tags and 
sometimes text; using [[WikiText]] markup in spreadsheet cells makes 
interesting things possible. I'd be glad to share examples; let me know 
here. Here, your best friend is the =concatenate(b1,b2,b3) formula, also 
expressed as =B1&B2&B32 or something like ="[["&b1&"]]" to as a way of 
mixing cell data with wikitext.

(c) I have found, again assuming you are using a spreadsheet, that 
collecting my "raw" data on one sheet in the workbook, and building 
tiddlers in another sheet, works the best. That way, you can concentrate on 
making sure your title, text and tags columns are well organized and clean, 
and the original data on the other sheet can be somewhat dirty. Be careful 
sorting spreadsheets; leads to sometimes unexpected results. If you have a 
lot of text, that presents some other challenges from time to time.

(2) Convert CSV to JSON

(a) The referenced conversion tool works well. Develop the habit of 
clearing input each time before uploading or copy/paste new CSV. I find 
that I engage in a cycle of download as CSV/convert CSV to json/import JSON 
in TW while I discover mistakes in my CSV; I correct mistakes, and have to 
do cycle again. At that point, make sure you clear input.

(b) For field with numeric values, choose "output option" to Force Wrap 
numeric values in double quotes, otherwise you will have no values.

(c) Use a distinctively named field, or tag, to filter all your imported 
tiddlers for the inevitable need to delete them all when you've messed up.

I use this code in my "Clean Up the Mess" tiddler:

There are <$count filter="[!field:unique-field-name[]]"/> tiddlers with a 
value in unique-field-name.<br>
<$button>
<$action-deletetiddler $filter="[!field:unique-field-name[]]"/>
Delete tiddlers with values in field:unique-field-name"
</$button>

Hope that helps. This will be a core lesson in the upcoming 
{{DesignWriteStudio}} Tiddlywiki "class" in January 2017. Stay tuned!

//steve.



On Sunday, October 23, 2016 at 9:58:08 AM UTC-4, Mark Heptinstall wrote:
>
> On Friday, January 8, 2016 at 10:07:14 PM UTC, Eric Shulman wrote:
>>
>>
>>> I did exactly that for TWClassic:
>>    http://www.tiddlytools.com/#CreateTiddlersFromCSV
>>
>> This was implemented as wikitext + HTML.... and all of the real work is 
>> in the HTML code, using onclick handlers.  You can ignore everything 
>> outside of the <html><nowiki>...</nowiki></html> block.  There's also a bit 
>> of stuff for selecting a tiddler to populate the textarea.  You can also 
>> ignore this.  It should be very easy to adapt this code to TW5, using an 
>> action widget in place of the onclick handler.
>>
>> enjoy,
>> -e
>>  
>>
>
> Has anyone successfully adapted this to TW5? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e1d5368e-3972-4e29-93b1-2e77039a45aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to