Select text from a line in a text file wiki

53 views
Skip to first unread message

Melvin

unread,
Sep 12, 2019, 5:33:53 PM9/12/19
to tiddl...@googlegroups.com
I have a tiddler called alphabet with the following content 

a
ab
abc
a b c
abcd

I want to create a filter expression that selects abc and abcd. So the result would be:

abc
abcd


I thought I would need to write something along the lines of:
[regexp:text[abc]]
or
[title[alphabet][text[abc]]

but at best variations on these types of method only give me the title as the result, which is:
alphabet

So what filter expression would I need to make that shows the text content itself of the specific tiddler called alphabet?

Note: I want to do it this way. I do not want to use key-value pairs from a data Tiddler. 

Aidan Grey

unread,
Sep 12, 2019, 5:44:46 PM9/12/19
to tiddl...@googlegroups.com
[Prefix[abc]]



On Thu, Sep 12, 2019, 3:33 PM Melvin, <melvi...@gmail.com> wrote:
I have a tiddler called alphabet with the following content 

a
ab
abc
abcd

I want to create a filter expression that selects abc and abcd. So the result would be:

abc
abcd


I thought I would need to write something along the lines of:
[regexp:text[abc]]
or
[title[alphabet][text[abc]]

but at best variations on these types of method only give me the title as the result, which is:
alphabet

So what filter expression would I need to make that shows the text content itself of the specific tiddler called alphabet?

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/16a691fd-a5a5-4191-bb3b-bfd7d3bf6019%40googlegroups.com.

Aidan Grey

unread,
Sep 12, 2019, 5:48:30 PM9/12/19
to tiddl...@googlegroups.com
Erk...hit send on accident. Re-read and discovered i addressed wrong issue but them my pinky...

Filter="[Search[abc]]"

The tiddlywiki article on the search operator has more details


Mark S.

unread,
Sep 12, 2019, 6:37:27 PM9/12/19
to TiddlyWiki

<$list filter="[title[alphabet]get[text]splitregexp[\n]prefix[abc]]">

</$list>

The gap between <$list> and </$list> is important.

Melvin

unread,
Sep 13, 2019, 4:51:37 AM9/13/19
to tiddl...@googlegroups.com
I see that this works in 5.20 (all kinds of handy iterative string functions have been added in 5.20) but since I'm using noteself, I'm on 5.17

Would you have any idea on how to do it in 5.17? I could try to figure out how to upgrade, but that'll be a difficult task.

Thanks though! I learned a lot through that single expression so I might be able to find another filter operator or multiple operators to help me out. :)

Edit: it's probably not possible before 5.18, since then it *might* be possible to hack around it with subfilter.

Filter expressions really have grown in the last few editions!

Melvin

unread,
Sep 13, 2019, 8:22:07 AM9/13/19
to TiddlyWiki
Ah, I solved it.

I tried to create a filter in TW 5.17, but it didn't work. The best things I got were things like:

[title[alphabet]each:list-item[text]]


But the problem is the set behavior. It can't parse on newlines.

At one point it simply occured to me that, while I don't know how to upgrade Noteself to TW 5.21, I did notice that all the string filter manipulations were contained within a single JS macro file. 

So I went to the TW website, found the right shadow tiddler, exported it and imported it into my Noteself version. And now I have the added filter functionality for strings.

I guess this is a prime example of partially upgrading TW in such a way that you get the needed functionality that one wants.
Reply all
Reply to author
Forward
0 new messages