How do I use "searchNreplace?"

70 views
Skip to first unread message

Banggao Jin

unread,
Nov 13, 2020, 6:02:47 PM11/13/20
to TiddlyWiki
Hi, I wanted to remove all "==" from my TiddlyWiki. How do I proceed? Thank you 


Mohammad

unread,
Nov 13, 2020, 11:50:36 PM11/13/20
to TiddlyWiki
A simple solution is to use the Commander. First read the tutorial

TW-Commander bulk operations on tiddlers  

Best wishes
Mohammad

TW Tones

unread,
Nov 14, 2020, 12:15:33 AM11/14/20
to TiddlyWiki
jin,

If you know what you are doing you could edit a single file tiddlywiki directly, however a method line Mohammad suggested is safer.

Where in tiddlywiki do you have these "==" values?

Tones

Eric Shulman

unread,
Nov 14, 2020, 12:40:17 AM11/14/20
to TiddlyWiki
On Friday, November 13, 2020 at 3:02:47 PM UTC-8 you wrote:
I wanted to remove all "==" from my TiddlyWiki.

Here's one way...

Put the following into a tiddler to create a button.  Then click the button:

<$button> remove "=="
   <$list filter="[all[tiddlers]!is[system]search:text[==]] -[<currentTiddler>]">
      <$action-setfield text={{{ [<currentTiddler>get[text]split[==]join[]] }}} />
   </$list>
</$button>

Notes:
1) The $list filter finds every tiddler that contains at least one occurrence of "==" (excluding the tiddler containing the button itself)
2) For each tiddler found, it gets the text content, splits it at each occurrence of "==" (removing the "==" in the process), and then joins the remaining text
3) It then replaces the original text content with the re-assembled text without the "=="

Be sure to backup your document before trying this, as it can change lots of tiddlers with a single click!

enjoy,
-e

TiddlyTweeter

unread,
Nov 14, 2020, 6:18:16 AM11/14/20
to TiddlyWiki
I agree with Mohammad that his Tiddler Commander is the single best tool to use in TW for bulk search and replace.

That said, It is vital to grasp that TW does NOT have UNDO that much regular software has.

So ALWAYS be SURE you know what you are doing! As most changes are irreversible. 

BACKING up before changes is essential!

Best wishes
TT
Reply all
Reply to author
Forward
0 new messages