SC: Formatlist "dedupe" of lists not in alphabetical order

Discuss and share scripts and script files...
Post Reply
40k
Posts: 234
Joined: 09 Dec 2011 21:25

SC: Formatlist "dedupe" of lists not in alphabetical order

Post by 40k »

For example:

a|b|d|e|b|a does not dedupe "b" or "a".
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

admin
Site Admin
Posts: 66298
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC: Formatlist "dedupe" of lists not in alphabetical ord

Post by admin »

As advertised in help:
"Removing duplicates only works on adjacent items, so if the list is not sorted non-adjacent duplicates remain in the list."

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: SC: Formatlist "dedupe" of lists not in alphabetical ord

Post by 40k »

admin wrote:As advertised in help:
"Removing duplicates only works on adjacent items, so if the list is not sorted non-adjacent duplicates remain in the list."
Oh. :whistle:
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

kiwichick
Posts: 675
Joined: 08 Aug 2012 04:14
Location: Windows 10 Pro 22H2, 150% scaling

Re: SC: Formatlist "dedupe" of lists not in alphabetical ord

Post by kiwichick »

Can someone please tell me what is wrong with this script? It sorts the list but doesn't remove duplicates. Cheers.

text formatlist(report("{basename} <crlf>"), sd);
Windows 10 Pro 22H2

highend
Posts: 14942
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: SC: Formatlist "dedupe" of lists not in alphabetical ord

Post by highend »

help file - formatlist()

separator
Separates the items in the list; defaults to | (pipe).
If you pass "" (empty) the list is treated as a list of single characters.

...
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 675
Joined: 08 Aug 2012 04:14
Location: Windows 10 Pro 22H2, 150% scaling

Re: SC: Formatlist "dedupe" of lists not in alphabetical ord

Post by kiwichick »

Thanks highend, The 'pipe' separator works. But then how do I display the results as a list? Cheers.
Windows 10 Pro 22H2

highend
Posts: 14942
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: SC: Formatlist "dedupe" of lists not in alphabetical ord

Post by highend »

?

What's wrong with:

Code: Select all

text formatlist(report("{basename}<crlf>"), "esd", "<crlf>");
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 675
Joined: 08 Aug 2012 04:14
Location: Windows 10 Pro 22H2, 150% scaling

Re: SC: Formatlist "dedupe" of lists not in alphabetical ord

Post by kiwichick »

Nothing wrong with it at all :biggrin: Thanks!!!
Windows 10 Pro 22H2

Post Reply