Remove Duplicate Word Phrases

Advanced Renamer forum
#1 : 16/01-16 21:24
Barry
Barry
Posts: 2
I have a situation where the file name contains duplicate word phrases. For example:

A Fox Jumps over the Road A Fox Jumps over the Road.mp3
The Black Cat The Black Cat.mp3

Is there any way to remove the duplicate words/phrases so I am left only with:

A Fox Jumps over the Road.mp3
The Black Cat.mp3

Appreciate any help.


16/01-16 21:24 - edited 16/01-16 21:25
#2 : 17/01-16 11:31
Tester123
Tester123
Posts: 92
Try this Replace method:

Text to be replaced: (.+) \1
Replace with: \1
Use regular expression: Tick

Quick Summary:
Look for one or more character(s) up to but not including a space, and place it in group 1: '(.+)'. Then look for the space followed by whatever was found in group 1: ' \1'. (The regular expression engine is clever enough to work out the combination of characters in group 1 which are then followed by a space and then repeated.)
Replace with what was found in group 1 only: '\1'.
This effective removes the space and the subsequent repeated string.


17/01-16 11:31 - edited 17/01-16 14:22
#3 : 17/01-16 15:25
Barry
Barry
Posts: 2
Reply to #2:
That worked! That you for the method and the summary explanation. Very helpful. Saves me a lot of time.


17/01-16 15:25
#4 : 25/01-16 04:14
Aron Mike
Aron Mike
Posts: 1
This method is good, I have been resolved, thank you


25/01-16 04:14
#5 : 25/06-16 11:14
patricia
patricia
Posts: 1
Hello Everyone!

I also recommend DuplicateFilesDeleter. You can choose to remove the detected duplicate or original files. The program is multi-threaded and performs scans quickly. Easy!


25/06-16 11:14
#6 : 15/10-16 09:47
Frank Jackson
Frank Jackson
Posts: 1
I have recently used a program called Duplicate Files Deleter & i am so happy with the results that this particular program does. I have more than 50 GB of duplicate files in my computer and i was going crazy with the hard disk space that was being consumed and thanks to the "Duplicate Files Deleter" where i don't need to search each & every file to delete. Duplicate Files Deleter did the job for me within a very short period of time. So no need to google each problem to remove duplicate & unwanted files, just grab the program called Duplicate Files Deleter.


15/10-16 09:47
#7 : 23/06-17 06:03
Egor
Egor
Posts: 1
Reply to #2:

Strangely, it does not exactly what I'd expected.

I have a bunch of imported font files (several thousand, company archive).
I used FontExpert to rename all of them according to actual font names.
It gives perfect results with most of them, but some fonts names got ugly:
Cabrito Norm Medium Italic Norm Medium Italic.otf
Klaus FY Bold Italic Bold Italic.otf
Sanchez Condensed ExtraLight ExtraLight Italic.otf
...

I've tried proposed method for removing duuped parts, but it does also this:
Adelle extrabold italic.otf > Adelleextrabold italic.otf
Adelle extrabold.otf > Adelleextrabold.otf

but leaves 'Adelle heavy italic.otf' unchanged

It looks like AR's treating spaces as occurrences, but why only somewhere then?

This method also does this:
Core Circus 2D Dot1 Regular.otf > Core Circus 2Dot1 Regular.otf (...D D... > D)
Brandon Text Thin Regular.otf > Brandon Texthin Regular.otf (T[1] T[2] > T[12])

What am I doing wrong?


23/06-17 06:03