#1 : 17/04-21 02:35 The Jackal
Posts: 6
|
How to remove duplicate words in one file name??
Some times when I use multiple Methods; I end up with many duplicate words in one single file, for examples: = File Name Name.txt = File File Name.txt = File Name File Name.txt How Can I clean these duplicates and make the final result = File Name.txt |
#2 : 17/04-21 11:56 David Lee
Posts: 1125
|
Replace: \b(([a-z]+\s+[a-z]+)|([a-z]+))\s+\1\b
with: \1 Occurrence: All NOT Case sensitive USE regular expressions Edit: If your "words" can contain numerical digits then use... Replace: \b((\w+\s+\w+)|(\w+))\s+\1\b but note that \w (word character) will also match an underscore ie \w is a shortcut for [A-Za-z0-9_] |
#3 : 17/04-21 20:21 The Jackal
Posts: 6
|
Reply to #2:
Wow! THANK YOU DAVID. Never in a million years did I think I'd figure it out on my own. Really, thank you so much for the help. |