INTERACT FORUM

Please login or register.

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

Author Topic: RMCF Tool: How to Write a Directories Rule that Ignores Unpopulated Fields?  (Read 2111 times)

Antoine.

  • World Citizen
  • ***
  • Posts: 180

Hi,

I'd like to have one of my preset for RMCF tool to classify and rename a file in a sub-directory based on its [grouping] value. But I also want this value to be ignored if this field is not populated.

Specifically, it looks like this in the RMCF tool (Rename mode) > Directories > Base Path > D:\[series]\[grouping]

I don't want the selected files to end up in an unnamed folder (itself in the [series] folder) if the [grouping] field is not populated. I want this part of the rule to be ignored in this case and the files to end up in the [series] folder.

Not unlike the [album artist (auto)] field, if I'm not mistaken.

How can I do that?

Antoine
Logged
Server: Windows 10 Pro (64bits) & MC26 - Caselabs Mercury S5 - Corsair HX1000i - ASRock Z97M OC Formula - Intel i7-4790t - 16Gb - Crucial M500 960GB - MSI GTX 960 Gaming 4G - RAID5 : WD Red 4TB (6x) + Adaptec 6805 - JBOD : WG Green 4TB (4x) - Hauppauge WinTV-HVR-2200 - Kef Egg.

HTPC: Windows 10 Pro (64bits) & MC25 - Streacom F12C  - Streacom FLIRC - Corsair HX750i - ASRock Z97 Extreme4 - Intel i5-4690s - 16Gb - Crucial M500 480GB - MSI GTX 960 Gaming 2G - Asus Essence STX II.

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871

You can typically add ,0 to the field to ensure that a blank value is output for an empty field - so [Series,0]

There are multiple ways that you can prepend [Series] to [Grouping] only if [Grouping] has a value.
The shortest is probably: Delimit([Grouping,0], ,Delimit([Series,0], /\, /\))
 
Details on the Delimit() function here.
Logged

Antoine.

  • World Citizen
  • ***
  • Posts: 180

Adding 0 is already really helpful for a lot of situations, thanks!

I'll need a bit more time to use the Delimit function.

Do you have any idea as to how I could have the following Filename rule :
Quote
[name] - [rating] stars
Only difference with this is that I want the whole " - [rating] stars" to disappear if [rating] value is empty...
I could use the "if" function, but is there an easier way to do that?
Logged
Server: Windows 10 Pro (64bits) & MC26 - Caselabs Mercury S5 - Corsair HX1000i - ASRock Z97M OC Formula - Intel i7-4790t - 16Gb - Crucial M500 960GB - MSI GTX 960 Gaming 4G - RAID5 : WD Red 4TB (6x) + Adaptec 6805 - JBOD : WG Green 4TB (4x) - Hauppauge WinTV-HVR-2200 - Kef Egg.

HTPC: Windows 10 Pro (64bits) & MC25 - Streacom F12C  - Streacom FLIRC - Corsair HX750i - ASRock Z97 Extreme4 - Intel i5-4690s - 16Gb - Crucial M500 480GB - MSI GTX 960 Gaming 2G - Asus Essence STX II.

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871

Code: [Select]
ListBuild(1, / -/ , [Name], RatingStars())
Alternatively:
Code: [Select]
ListBuild(1, / -/ , [Name], Delimit([Rating,0], / stars,))
ListBuild()
 
The forward slashes are used to escape the spaces; i.e. force them to be included in the delimiter so that you get "[Name] - RatingStars()" rather than "[Name]-RatingStars()".
Logged

Antoine.

  • World Citizen
  • ***
  • Posts: 180

Awesome! Thanks again!

The listbuild function is really helpful because I wanted to rename a ton of files and include lots of values in the filenames (some populated, some not). I started with the if() function: always helpful but way more tiresome!
Logged
Server: Windows 10 Pro (64bits) & MC26 - Caselabs Mercury S5 - Corsair HX1000i - ASRock Z97M OC Formula - Intel i7-4790t - 16Gb - Crucial M500 960GB - MSI GTX 960 Gaming 4G - RAID5 : WD Red 4TB (6x) + Adaptec 6805 - JBOD : WG Green 4TB (4x) - Hauppauge WinTV-HVR-2200 - Kef Egg.

HTPC: Windows 10 Pro (64bits) & MC25 - Streacom F12C  - Streacom FLIRC - Corsair HX750i - ASRock Z97 Extreme4 - Intel i5-4690s - 16Gb - Crucial M500 480GB - MSI GTX 960 Gaming 2G - Asus Essence STX II.
Pages: [1]   Go Up