Discussion:
[tw] Search duplicate caption-fields
(too old to reply)
magev958
2018-02-08 17:17:28 UTC
Permalink
Raw Message
Most of my tiddlers have a uuid-title and a caption-field. With the
collection of tiddler growing I have come across a couple of tiddler with
same caption. I would likt to find all duplicates but don't know how
/Magnus
--
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 post to this group, send email to ***@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/f8b2a607-bd66-4e04-95f7-4c2015bbbac4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BurningTreeC
2018-02-08 18:18:51 UTC
Permalink
Raw Message
hello Magnus,

this could do what you need:

\define compareCaptions()
<$list filter="[[$(firstTidCaption)$]regexp[^$(thisTidCaption)$$]]">

$(firstTiddler)$ and $(thisTiddler)$ have the same caption
<$button message="tm-edit-tiddler" param="""$(thisTiddler)$""">edit
$(thisTiddler)$</$button>

</$list>
\end
\define compareTiddlers()
<$list filter="[all[tiddlers]!is[current]has[caption]]">
<$set name="thisTiddler" value=<<currentTiddler>>>
<$list filter="[<thisTiddler>get[caption]]" variable="thisTidCaption">
<<compareCaptions>>
</$list>
</$set>
</$list>
\end
<$list filter="[all[tiddlers]has[caption]]">
<$set name="firstTiddler" value=<<currentTiddler>>>
<$list filter="[<firstTiddler>get[caption]]" variable="firstTidCaption">
<<compareTiddlers>>
</$list>
</$set>
</$list>

Simon
Post by magev958
Most of my tiddlers have a uuid-title and a caption-field. With the
collection of tiddler growing I have come across a couple of tiddler with
same caption. I would likt to find all duplicates but don't know how
/Magnus
--
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 post to this group, send email to ***@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/8278dfb0-0296-4fd1-b600-bbd1e66acdcb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Mark S.' via TiddlyWiki
2018-02-08 18:22:08 UTC
Permalink
Raw Message
Using only tools available in the core, this works:

<$list
filter="[all[tiddlers]has[caption2]each[caption2]get[caption2]sort[caption2]]"
variable="capt">
<$list filter="[field:caption2<capt>count[]prefix[2]suffix[2]]
[field:caption2<capt>count[]prefix[3]suffix[3]]" >
Caption: <<capt>> used in<br/>
<$list filter="[field:caption2<capt>]">
<<currentTiddler>><br/>
</$list>
<br/>
</$list>
</$list>

You will want to change "caption2" to "caption" (I needed a smaller data
set for testing).
This checks for duplicates of 2 or 3. You can repeat the run for 4, 5 ...
etc. However many duplicate captions you think you might have. The problem
is that there are no number-manipulating functions in the core. Also, there
is no equality filter in the core, so I'm using prefix/suffix which breaks
down for higher numbers with the same number on back and front (e.g. 22)

Good luck
-- Mark
Post by magev958
Most of my tiddlers have a uuid-title and a caption-field. With the
collection of tiddler growing I have come across a couple of tiddler with
same caption. I would likt to find all duplicates but don't know how
/Magnus
--
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 post to this group, send email to ***@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/925bc803-aa48-45d5-912c-5a88a1154b38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
TonyM
2018-02-09 15:10:46 UTC
Permalink
Raw Message
Why not have a list of all captions wrapping a list of all Tiddlers that have the same caption. Most may have one tiddler with each caption but you can make it obviouse for captions who have more than one toddler.

Has[caption]

List all Tiddlers with each caption.

Tony
--
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 post to this group, send email to ***@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/63a73f8e-b833-44e8-b7ba-015dbc2785d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2018-02-10 21:40:52 UTC
Permalink
Raw Message
Hi Magnus,
Post by magev958
Most of my tiddlers have a uuid-title and a caption-field. With the
collection of tiddler growing I have come across a couple of tiddler with
same caption. I would likt to find all duplicates but don't know how
I had success with the following code (seems to list all duplicates of two
or more, no matter how many):

<$list filter="[each[caption]get[caption]]" variable="capt">
<$list filter="[field:caption<capt>rest[1]get[caption]]" variable="capt2">

!!! Caption "<<capt2>>":
<ul>
<$list filter="[field:caption<capt2>]">
<li><$link>{{!!title}}</$link></li>
</$list>
</ul>
</$list>
</$list>

Cheers,

Stef
--
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 post to this group, send email to ***@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/ccc431f8-b146-4c1f-9cc2-d8509b101e56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2018-02-10 21:50:06 UTC
Permalink
Raw Message
Just noticed that my code above had a small bug - when one particular
caption appeared more than twice, the caption was listed multiple times.
I've fixed it here:

<$list filter="[each[caption]get[caption]]" variable="capt">
<$list filter="[field:caption<capt>rest[1]limit[1]get[caption]]"
variable="capt2">


!!! Caption "<<capt2>>":
<ul>
<$list filter="[field:caption<capt2>]">
<li><$link>{{!!title}}</$link></li>
</$list>
</ul>
</$list>
</$list>

Cheers,

Stef
Post by s***@gmail.com
I had success with the following code (seems to list all duplicates of two
--
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 post to this group, send email to ***@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/3ef9ece9-e424-4aa6-b7fa-45bc9fc7d5b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
magev958
2018-02-11 15:57:52 UTC
Permalink
Raw Message
Thanks I got it to work as expected :)
I haven't had time until yesterday today

@B
<http://www.google.com/url?q=http%3A%2F%2Ftw5magick.tiddlyspot.com%2F%23bookify&sa=D&sntz=1&usg=AFQjCNF2VmeH02qo5lCc9PKo6Ok16jCRMw>urningTree
I tried your code to, but it made my browser to hang. I guess it was to
complex :D

Thanks for your help
/Magnus
Post by s***@gmail.com
Just noticed that my code above had a small bug - when one particular
caption appeared more than twice, the caption was listed multiple times.
<$list filter="[each[caption]get[caption]]" variable="capt">
<$list filter="[field:caption<capt>rest[1]limit[1]get[caption]]"
variable="capt2">
<ul>
<$list filter="[field:caption<capt2>]">
<li><$link>{{!!title}}</$link></li>
</$list>
</ul>
</$list>
</$list>
Cheers,
Stef
Post by s***@gmail.com
I had success with the following code (seems to list all duplicates of
--
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 post to this group, send email to ***@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/4b64a6eb-27d3-454a-a4ff-0b6fc66e159f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
HansWobbe
2018-02-11 16:25:49 UTC
Permalink
Raw Message
@Stef: Elegantly simple. It helped me clean up a bad practice. Thanks
for sharing. ~ Hans
Post by s***@gmail.com
<$list filter="[each[caption]get[caption]]" variable="capt">
<$list filter="[field:caption<capt>rest[1]limit[1]get[caption]]"
variable="capt2">
<ul>
<$list filter="[field:caption<capt2>]">
<li><$link>{{!!title}}</$link></li>
</$list>
</ul>
</$list>
</$list>
--
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 post to this group, send email to ***@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/585adcb9-d99b-416d-ac16-a20baa9764c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...