Save the generated content of a tiddler possible?

Hi TW-Experts,

I have this procedure what is generating a list from fields, and it is working well.

\whitespace trim
\procedure tids2csv(selector, fields, separator:'|')
<$let
    fields={{{ [<fields>!match[]] ~[[info/db_tables]get<selector>] }}}
>
<$list filter="[enlist<fields>]" join=<<separator>> ><<currentTiddler>></$list><br/>
<br>
<$list filter="[tag<selector>]" variable="subfield">
  <$list filter="[enlist<fields>]" join=<<separator>> variable="field"><$text text={{{ [<subfield>get<field>] }}} /></$list><br/>
</$list>
</$let>
\end

The Tiddler where I Use this procedure is simple

title: Export

<<tids2csv "Employee" "Name Zip City Street Number Mail Phone" >>

The result

Stefan|12345|Hamburg|Wall|12|stefan@stefan.de|+491234567890|
Kurt|98765|Berlin|Ring|98|kurt@kurt.com|+499876543210|

How can I create a save button (or implement it in the tids2csv procedure) to save the result to a file?

Thank you for any support
Stefan

There is an existing option to export a list of tiddlers as CSV

Use the export options like @pmario suggested or develop your own

https://tiddlywiki.com/#Creating%20a%20custom%20export%20format

Hi @pmario ,

this is not working. I have no filter expression :slight_smile: I need to use this procedure call <<tids2csv "Employee" "Name Zip City Street Number Mail Phone" >>

And I need to make it user freindly with a button or similar :slight_smile:

Any idea to solve it?

Stefan

Hi @TW_Tones ,

it is looking interesisting but I do not have a filter expression I need to use this procedure call <<tids2csv "Employee" "Name Zip City Street Number Mail Phone" >>.
And I need to make it user freindly with a button or similar :slight_smile:

Any idea to solve it?

Stefan

Stefan,

I don’t have enough recent experience with csv in TiddlyWiki but I recall additional support is available with “JSON Mangler” plugin.

The output data you share is not actually csv, which is comma delimited, not | delimited, and there is no | at the beginning of the lines. Also CSV often contains the field/collum names in the first row.

However you generate the output, if you can display it on the screen you can;

  • select and copy it and save in a file using an local editor, such as NotePad++.
  • However before you do that keep reading.

On every tiddler there is a button to Export Tiddler and select an export type. You can use this to save the tiddler as a file.

  • However what export do you need?
  • To combine multiple tiddlers into a csv file you need a filter to search for them then use the multiple tiddler csv export.

Identify a filter that would list all the tiddlers that make up the rows and use that in Advanced search Filter tab, then use the export PMario suggested.

  • Try it and look inside the resulting export
  • It identifies all fields in all resulting tiddlers and generates a csv with each fields values.