filtering a area of tiddlers from prefix numbers

90 views
Skip to first unread message

tobaisch

unread,
Dec 28, 2017, 8:53:26 PM12/28/17
to TiddlyWiki
Hello,
all my tiddlers have a number in the title as a prefix.

"0001-ABC" to "1000-EGAL".
How can I list a section in a filter list, for example the 40 Tiddlers "0120 XYZ" to - "00160 ABF"?
I also have a field "nr" with the value: "0001 to 1000" but this is not yet correctly filled out by all Tiddlers, so I would like to filter with the prefix.
is this possible?
Of course, I am also interested in the solution for filtering an area with the "field" variant.
Regard
Tob

TonyM

unread,
Dec 28, 2017, 11:12:00 PM12/28/17
to TiddlyWiki
Tob,

Of course you can use the Prefix filter, however in your case you are changing the prefix. It may depend on the tiddlers you have in the rest of the wiki ie a prefix of "0" and another of "1" will find all tiddlers in the range you ask but may collect others.

An approach to try is to wrap one list in another, to create a value you will use as a prefix.

eg;

<$list filter="0 1 2 3 4 5 6 7 8 9" variable=1sd >
  <$list filter="0 1 2 3 4 5 6 7 8 9" variable=2sd >
     <$list filter="0 1 2 3 4 5 6 7 8 9" variable=3sd >
        <$list filter="0 1 2 3 4 5 6 7 8 9" variable=4sd >
        <<1sd>><<2sd>><<3sd>><<4sd>>
        </$list>
     </$list>
  </$list>
</$list>

This is not a solution but perhaps a path to one.

Regards
Tony

Mark S.

unread,
Dec 29, 2017, 12:14:43 AM12/29/17
to TiddlyWiki
There's a difference between your two titles: 0120 and 00160. Can we assume this was a mistake? So they should be 0120 and 0160 ?

I'm thinking that the best bet would be to use the regex filter, with a filter like ^01[23456][0-9]". You have to wrap these regular expressions with square brackets in a variable.

So for your example you would have:

<$vars reg="^01[23456][0-9]">
<<list-links "[regexp<reg>]">>
</$vars>


-- Mark

tobaisch

unread,
Dec 29, 2017, 1:34:26 AM12/29/17
to TiddlyWiki
There's a difference between your two titles: 0120 and 00160. Can we assume this was a mistake?

Oh yes, it was a mistake!
Thanks TonyM thanks Mark S.
Mark, your solution looks very simple and works perfekt.
Regards
Tob


Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages