INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Special Characters when Renaming  (Read 941 times)

pierre.goyette

  • Recent member
  • *
  • Posts: 42
Special Characters when Renaming
« on: February 22, 2014, 08:59:13 pm »

Media Center nicely changes all special characters such as a colon to an underscore when renaming files. 

I would prefer a dash "-" instead of an underscore when renaming files/directories.  I looked all over to see if this was configurable but cannot find it.

Cna I change the replacement character and if so, where ?

TIA
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Special Characters when Renaming
« Reply #1 on: February 22, 2014, 10:48:13 pm »

Rename internally uses the function Clean() in mode 3.  So you have to do your own replacement before Rename gets a hold of it.  Like this, if your Rename template is:

   [Track #] - [Name]

you might do:

   replace([Track #] - [Name], :, -)

which replaces a colon character with a dash, whereby Rename is happy.  To do this for all the other characters as well, you can either nest loads of Replace() calls, or do this trick:

   replace(clean([Track #] - [Name], 3), _, -)

which Cleans() the string first, converting FS illegal characters to underscore, and the Replace() converts those to dash characters.
Logged
The opinions I express represent my own folly.

pierre.goyette

  • Recent member
  • *
  • Posts: 42
Re: Special Characters when Renaming
« Reply #2 on: February 23, 2014, 06:41:28 am »

Awesome !  That did the trick.  Thanks. :)
Logged
Pages: [1]   Go Up