Rename Script Help [removing custom words]

Using leo's code to replace all dots with spaces, I'd like to add to it, but need some help!
For example, with leo's code I have attempted to add to it myself doing this gives me error messages even though it more or less works.

@NoDeselect
Rename REGEXP PATTERN="(.)(([^0-9]).|.([^0-9]))(...)#" TO="\1\3 \4\5" TYPE=files
Rename REGEXP PATTERN="(.
)(([^0-9]).|.([^0-9]))(.*)#" TO="\1\3 \4\5" TYPE=dirs

Rename PATTERN="_" TO=" " FINDREP
Rename PATTERN=" " TO=" " FINDREP

Rename PATTERN="pdtv" TO=" " FINDREP
Rename PATTERN="xvid" TO=" " FINDREP
Rename PATTERN="dvd" TO=" " FINDREP

I want to:
- Replace all dots with spaces [xx.xx becomes xx xx]
[b]- Replace all underscores with spaces. [xx_xx becomes xx xx]

  • Add spaces around dashes [xx-xx become xx - xx]
  • Replace multiple spaces (2 or more) with just 1 space [xx xx becomes xx xx]
  • Add custom words that I find I am often deleting eg: pdtv, dvd, xvid [xx pdtv become xx] [/b]
    You will see I tried to replace custom words above using the Rename Pattern. I wonder if it's possible to do it in one line, for example Rename PATTERN="pdtv", "xvid" TO " " FINDREP
    Furthermore is it possible to simply Remove the words (without having to replace it with a space or character?)

Would there be a neater and more efficient way of producing this? Thanks.

no one can help...........?

Most, if not all of your request are already described in the "scripts" section of this board:

resource.dopus.com/viewforum.php?f=26

There's a special ~ string that means "empty string" for the TO argument:

Rename PATTERN="xvid" TO="\~" FINDREP

Have a look at the TitleCase rename script, too.

Thankyou for replying. If this is the reason no one is replying, then I am sorry for asking what has been answered. Thankyou for letting me know about that section of the forum. Though, I do know it exists and have read through every thread in that section (minus a few), multiple times. Trying to see if all my questions were answered. But a couple I couldn't find. My ideas for making this were stemmed from those other threads.

I guess these points where are really what I could not find anything about:

  • Replace multiple spaces (2 or more) with just 1 space [xx xx becomes xx xx]
  • Add custom words that I find I am often deleting eg: pdtv, dvd, xvid [xx pdtv become xx]
    You will see I tried to replace custom words above using the Rename Pattern. I wonder if it's possible to do it in one line, for example Rename PATTERN="pdtv", "xvid" TO " " FINDREP
    Furthermore is it possible to simply Remove the words (without having to replace it with a space or character?)

I was trying to ask how to mesh these codes together and still work. Because when I try to mesh them together it doesn't work properly!

Perhaps those other points have been explained elsewhere, do you have any idea where I could find more info? I promise I am not being lazy I truely have read everything here and google, maybe I am a bit blind or missing something.

Maybe my request for help was too big for my first.

:blush: :

If you want to do lots of renames in a row then using a sequence of commands can work okay, but if it becomes complex it's better to switch to using a rename script (using VBScript, Javascript, Perl, etc.).

The TitleCase rename script already does many of the things you're after so check that out first.

Another post/script you might find useful is Script to perform multiple Regular Expressions.