INTERACT FORUM

Please login or register.

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

Author Topic: Expression help  (Read 760 times)

w_axlrose1

  • Junior Woodchuck
  • **
  • Posts: 58
Expression help
« on: August 14, 2020, 06:33:56 am »

Hello all,

I'm wondering if anybody can please assist me with an expression to rename directories in which I keep my photos. Up until this point I had always used as an example the following directory format:

D:\Photos\Stonehenge 15-Jul-2020

What I'd like to be able to do is switch things around using the ISO 8601 date standard and put the date first so I end up with this:

D:\Photos\2020-07-15 Stonehenge

I've made some progress with the following expression in Rename, Move & Copy Files under the Directory expression box...

FormatDate([Date,0],yyyy-MM-dd) FileFolder()

This has resulted in renaming the folder as follows...

D:\Photos\2020-07-15 Stonehenge 15-Jul-2020

The crux of the question is does anybody know how to remove the now superfluous date from the end of the directory name? Since the unwanted portion of the directory name is always the last 12 characters (including the space) I was wondering if there was a way to get the expression to remove those last 12 characters automatically. That's as far as my thinking takes me.

Thanks to anyone that is able to help. :)
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Expression help
« Reply #1 on: August 14, 2020, 06:48:24 am »

In the "String Manipulation" section of the wiki expressions pages, you will find RemoveRight()...

removeright(FormatDate([Date,0],yyyy-MM-dd) FileFolder(),12)

ought to do it for you :)

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Expression help
« Reply #2 on: August 14, 2020, 06:55:32 am »

btw... always thrilled to learn people are using MC to manage their photos...

How are you finding the experience?

If you have time, perhaps you could add comments to this thread?

regards,
-marko

w_axlrose1

  • Junior Woodchuck
  • **
  • Posts: 58
Re: Expression help
« Reply #3 on: August 14, 2020, 07:52:17 am »

In the "String Manipulation" section of the wiki expressions pages, you will find RemoveRight()...

removeright(FormatDate([Date,0],yyyy-MM-dd) FileFolder(),12)

ought to do it for you :)

Oh you star! Thanks very much, Marko. That's exactly what I needed.
Logged

w_axlrose1

  • Junior Woodchuck
  • **
  • Posts: 58
Re: Expression help
« Reply #4 on: August 14, 2020, 08:03:23 am »

btw... always thrilled to learn people are using MC to manage their photos...

How are you finding the experience?

If you have time, perhaps you could add comments to this thread?

regards,
-marko

I'm actually finding the photo management to be exremely useful. Previously I had no real photo management and I'd simply browse the folders in Explorer which was too cumbersome once a lot of images were involved. For some reason I didn't fully digest that I already had the solution all along in JRiver which I had been using for music/video for quite a few years. I decided to give it whirl and imported all my images. Now I can find the image I need by location, date, person, camera, you name it by utilising JRiver's powerful search function. One of my favourite features (albeit quite a modest one) is the ability to 'locate on Google Maps'.
Logged
Pages: [1]   Go Up