INTERACT FORUM

Please login or register.

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

Author Topic: Help with a Rename, Move, Copy expression  (Read 621 times)

AlanDistro

  • World Citizen
  • ***
  • Posts: 138
Help with a Rename, Move, Copy expression
« on: September 28, 2019, 08:05:52 am »

Hi all, not sure if this is possible, but if it is, could someone help me with an expression in the Rename, Move, Copy tool that would put movie files in a subfolder based on the first letter of the movie's Name?

For example, if the movie's Name is "Terminator 2: Judgement Day", I would like to Rename and Move from
.../_Ripped_/Terminator 2.mkv
to
.../Media/Movies/T/Terminator 2.mkv

It's that "T" folder I need to be dynamic but I don't know how to accomplish that. That way the next movie, say for example, "Halloween" would then go to
.../Media/Movies/H/Halloween.mkv

I don't want to throw a thousand movie files into one folder, using the subfolders should help make browsing and folder load times a bit easier for me. Thanks in advance!
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Help with a Rename, Move, Copy expression
« Reply #1 on: September 28, 2019, 08:54:59 am »

I have exactly this.

Make a new Library Field called [Name Letters] (or whatever you want) with the following expression:
Code: [Select]
If(IsEmpty([Series],0),Regex([Name], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), 0 - 9, [R1]),Regex([Series], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), 0 - 9, [R1]))
Then, use that in your RMCF. It consolidates numbers into an item called "0-9" and ignores articles. If you need additional articles to be ignored, add them onto the (?:the|an|a) sections.

If you don't use [Series] for your Movies at all, then you can simplify that to remove the [Series] logic (though it won't hurt really). If the movie is tagged with a [Series] it will spit out the first letter of the Series title, if [Series] is blank, it spits it out for [Name].
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

AlanDistro

  • World Citizen
  • ***
  • Posts: 138
Re: Help with a Rename, Move, Copy expression
« Reply #2 on: September 28, 2019, 10:56:13 am »

Thank you, that worked perfectly!
Logged
Pages: [1]   Go Up