You are here: PSPad forum > English discussion forum > How to delete duplicate ?

How to delete duplicate ?

#1 How to delete duplicate ?

Posted by: maki | Date: 2017-11-29 19:06 | IP: IP Logged

How to quickly find the repeated number and delete DUPLICAT?
2,5,7,9,10,13,16,20,11,12,19,22,25,33,32,35,36,37,42,58,64,66,70,74,78, 29,38,43,45,50,51,56,60,61,65,77,41,44,56,71,72,75,6,8,15,23,26,27,49,55,59,68

Options: Reply | Quote | Up ^


#2 Re: How to delete duplicate ?

Posted by: pspad | Date: 2017-11-29 19:30 | IP: IP Logged

You need to transform it into column, then you can remove duplicates:
menu Edit / Sort (with remove duplicates)
or
menu Edit / Lines manipulation / Remove duplicate lines

Options: Reply | Quote | Up ^


#3 Re: How to delete duplicate ?

Posted by: maki | Date: 2017-11-30 12:06 | IP: IP Logged

I do not understand how to transform?
I should do the same with all numbers all time, I will want to add, it is a waste of time.
If you know a different, better tool for removing duplicate numbers, I will be happy to learn about it.

Options: Reply | Quote | Up ^


#4 Re: How to delete duplicate ?

Posted by: pspad | Date: 2017-11-30 12:15 | IP: IP Logged

If you want to remove duplicities from line, write script.
You can temporary transform it into column, remove duplicities with PSPad command and transform it back to line. All in one step.

Options: Reply | Quote | Up ^


#5 Re: How to delete duplicate ?

Posted by: Andreas | Date: 2017-12-03 20:17 | IP: IP Logged

It's a good idea to learn some JavaScript.

var
myCommaSeparatedInputString = '2,5,7,9,2,4,6,5,9,8,7,4,12,5',
myUniqueOutputString = Array.from(new Set(myCommaSeparatedInputString.split(','))).join()
;

We can test it directly with devtools in Firefox (F12) -> JS-Environment.

console.clear();

var
myCommaSeparatedInputString = '2,5,7,9,2,4,6,5,9,8,7,4,12,5',
myUniqueOutputString = Array.from(new Set(myCommaSeparatedInputString.split(','))).join()
;

console.log(myCommaSeparatedInputString);
console.log(myUniqueOutputString);

Output:
21:13:38.354 Konsole wurde geleert. Scratchpad/1:1
21:13:38.354 2,5,7,9,2,4,6,5,9,8,7,4,12,5 Scratchpad/1:8:1
21:13:38.355 2,5,7,9,4,6,8,12 Scratchpad/1:9:1

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR