Remove duplicate/repeated words

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Remove duplicate/repeated words

Postby piattobbaratto » Thu Nov 25, 2021 9:33 am

I was looking for a script or RegEx expression to remove repeated words. As you can see I have lots of characters: _ ( ) - [ ] { } = *space*
I would like to replace these characters with an underscore, and then remove all the duplicate words.

For instance, I'd like to change:

Code: Select all
dmg_sm0993_event (summonedtable) 0039-event [damage=hit_defend_fail_se_0039_type=slash_low] [damage_fail_type=defend_fail] {!} {r} {m} {s} {e}


To (both "{}" and characters inside are not needed.)

Code: Select all
dmg_sm0993_event_summonedtable_0039_damage_hit_defend_fail_se_type_slash_low
piattobbaratto
 
Posts: 6
Joined: Fri May 17, 2019 1:01 am

Re: Remove duplicate/repeated words

Postby therube » Fri Nov 26, 2021 5:56 pm

Not sure if something here will cover you or not, repeated ?
therube
 
Posts: 1310
Joined: Mon Jan 18, 2016 6:23 pm

Re: Remove duplicate/repeated words

Postby piattobbaratto » Sat Nov 27, 2021 5:39 am

therube wrote:Not sure if something here will cover you or not, repeated ?


I read everything but nothing seems to work. I'm aware that what I'm asking is kinda complicated.
Anyway, I don't have to do everything with a single command.

Multiple steps are fine too.
piattobbaratto
 
Posts: 6
Joined: Fri May 17, 2019 1:01 am

Re: Remove duplicate/repeated words

Postby Admin » Sat Nov 27, 2021 9:45 am

This can be done with a little program in Javascript.

a) replace specific characters with space.
b) split name into words.
c) from first word : if not found same word before then word add to name, separated by space.
d) apply name.

But Javascript requires a commercial license.
Admin
Site Admin
 
Posts: 2341
Joined: Tue Mar 08, 2005 8:39 pm

Re: Remove duplicate/repeated words

Postby piattobbaratto » Sat Nov 27, 2021 11:36 am

Admin wrote:This can be done with a little program in Javascript.

a) replace specific characters with space.
b) split name into words.
c) from first word : if not found same word before then word add to name, separated by space.
d) apply name.

But Javascript requires a commercial license.


Yeah, I forgot to mention that I own a commercial license. Are you able to create a similar script?
It seems a little too complex to create it myself. It's totally out of my skills.

Thanks.
piattobbaratto
 
Posts: 6
Joined: Fri May 17, 2019 1:01 am

Re: Remove duplicate/repeated words

Postby Admin » Sun Nov 28, 2021 12:19 am

Hi, can you add some more examples of from -> to names wanted here and send you license info to support via e-mail? Thanks
Admin
Site Admin
 
Posts: 2341
Joined: Tue Mar 08, 2005 8:39 pm


Return to Javascript Renaming