INTERACT FORUM

Please login or register.

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

Author Topic: Help with directory template, rename expression  (Read 836 times)

paronsoda

  • World Citizen
  • ***
  • Posts: 102
Help with directory template, rename expression
« on: February 05, 2018, 01:54:49 pm »

Hi

I got such great help last time with a template for renaming files. I hope I can get some advice again with creating or removing space/blank. I have a template for renaming files based on Series, Season, Episode, Name and Date. This give me as result something like this:

Game Of Thrones - (s01a01) Winter is coming [2011].mkv

But in some cases there is nothing in the fields Name or Date. In this case I use the following expression If(IsEmpty([Date],1),,[[Date]]). But as I have a blank between the two expressions Episode and Date the result is that either there will be a extra space in the end when there is no date, like this:

Game Of Thrones - (s01a01) Winter is coming .mkv

or there is missing a space when there is a date, like this:

Game Of Thrones - (s01a01) Winter is coming[2011].mkv

I have similar problem when some series don't have names for each episode and I either miss a space or there is double space. I have tried to add a space in the expression after the two commas like this If(IsEmpty([Date],1),, [[Date]]). But it doesn't have any effect. The only workaround I have found is to use _ (underscore). Is there any other way to do it?

Thanks for any guidance
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Help with directory template, rename expression
« Reply #1 on: February 05, 2018, 02:39:32 pm »

The "date or no date" issue looks easy enough... just put the space in.... like so...

If(IsEmpty([Date],1),,/ [[Date]]

spaces after a comma are ignored by default, so you need to escape it using the forward slash for the expression to use it literally.

Does that help you to fix the [name] issue yourself?

paronsoda

  • World Citizen
  • ***
  • Posts: 102
Re: Help with directory template, rename expression
« Reply #2 on: February 06, 2018, 12:56:10 pm »

Hi Marko

And thanks again for great help. It worked perfect with forward slash.

Cheers
Logged
Pages: [1]   Go Up