INTERACT FORUM

More => Old Versions => JRiver Media Center 25 for Windows => Topic started by: mvandyke on November 26, 2019, 08:45:29 am

Title: Display Files that need to be changed - Fixcase
Post by: mvandyke on November 26, 2019, 08:45:29 am
I have a rather large library and would like to display files that would require a fixcase (either all in lower case) or in UPPER CASE.  I've used the Clean File Property's extensively but it's hard to search through 10's of thousands of files.

Is their an expression or trick to display lower case or upper case fields?

Thanks
Title: Re: Display Files that need to be changed - Fixcase
Post by: Matt on November 26, 2019, 08:47:45 am
Sure thing.  This expression will show the name in all upper-case:
FixCase([Name], 3)

Lower-case and other fields should follow along.
Title: Re: Display Files that need to be changed - Fixcase
Post by: mvandyke on November 26, 2019, 09:16:10 am
Thanks Matt for the quick turnaround.  What is the best way to leverage this expression to show only files that have names in UPPERCASE.  I tried adding it a display field but that didn't seem to work.

I'm a long time JR user but getting more involved in fixing metadata now.  I've spent a lot of time searching for this in the support forum but unable to locate a fix.

Thanks
Matt
Title: Re: Display Files that need to be changed - Fixcase
Post by: Matt on November 26, 2019, 09:27:38 am
There's a IsLowerCase(...) function, but I don't think there is an IsUpperCase function.  I could add it to MC26.
Title: Re: Display Files that need to be changed - Fixcase
Post by: Matt on November 26, 2019, 09:44:40 am
I just got done adding it to MC26.  Thanks for the suggestion.
Title: Re: Display Files that need to be changed - Fixcase
Post by: Moe on November 26, 2019, 10:34:18 am
This isn't perfect, but this expression will find any file that has three capital letters in a row in the name field

Code: [Select]
ifelse(regex([name], /#^[A-Z]{3,}#/, 0, 1), Fix your case!)
If you want to change it from three letters in a row to a different number, change this bit of the expression {3,}

This should find all tracks that don't have a capital letter in the name

Code: [Select]
if(regex([name], /#^[0-9,A-Z]{1}#/, 0, 1),,all lower)
Title: Re: Display Files that need to be changed - Fixcase
Post by: blgentry on November 26, 2019, 02:45:28 pm
Building on Moe's concept.  Here's a regex that should find most all uppercase [Name] fields (song titles):

Code: [Select]
ifelse(regex([name], /#^[A-Z0-9 \.\+\?\&\(\)\$\#]+$}#/, 0, 1), Fix your case!)
If your song titles contain special characters that I have not accounted for, like the @ or " or ' (for example) then my expression won't work.  As a side effect, it's also going to detect song names with only special characters and ONLY numbers or combinations of these three.  But it should still be useful.

Change the expression so that A-Z becomes a-z and it will detect the same thing, but in all lowercase.

Brian.
Title: Re: Display Files that need to be changed - Fixcase
Post by: Moe on November 26, 2019, 03:34:24 pm
Brian, you've got an extra } in there.  It should read

Code: [Select]
ifelse(regex([name], /#^[A-Z0-9 \.\+\?\&\(\)\$\#]+$#/, 0, 1), Fix your case!)
Title: Re: Display Files that need to be changed - Fixcase
Post by: mvandyke on November 26, 2019, 04:21:08 pm
That works.  Thanks to all for your help.

Matt
Title: Re: Display Files that need to be changed - Fixcase
Post by: Moe on November 26, 2019, 09:24:46 pm
This could get distilled all the way down to

Code: [Select]
ifelse(regex([name], /#^[-A-Z\d\s_.+?&()$#]+$#/, 0, 1), Fix your case!)
(Sorry, still trying to improve my regex skills and this was an interesting exercise :))