INTERACT FORUM

More => Old Versions => JRiver Media Center 23 for Windows => Topic started by: stumpygremlin on June 27, 2018, 10:53:41 pm

Title: Renaming files with short names?
Post by: stumpygremlin on June 27, 2018, 10:53:41 pm
Is it possible to rename my music files with the following structure:
D:\Music\Albums\
where the * is the first letter of the artist's name and the filename is limited to the first eight characters of the title?

So for example, the song "Pull Me Under" by Dream Theater off of the "Images & Words" album would be named:
D:\Music\Albums\D\Dream Theater - Images & Words\Pull Me.mp3


If so, how do I do it?
Title: Re: Renaming files with short names?
Post by: marko on June 27, 2018, 11:35:35 pm
Open the rename, move & copy files tool...

Make sure the top left is set to "Rename...."

Under directories...
set the base path to: D:\Music\Albums\
Set the rule to: mid([artist],0)\[artist] - [album]\

Under filename...
Set the rule to: left([name],8)

Press OK and the job's done.
(https://mpw.scot/pics/ia/24/Snap-019.jpg)

Strange naming convention, will definately result in a lot of files with trailing spaces at the end of their names. Why do you need that, if you don't mind me asking?

-marko
Title: Re: Renaming files with short names?
Post by: RoderickGI on June 28, 2018, 12:02:17 am
You may want to enhance that filename rule to something like:

Clean(RemoveCharacters(left([name], 8), ., 3))

Which trims to eight characters, removes leading and trailing ".", and then removes empty () and [], superfluous dash (-) and whitespace characters and sometimes comma. That will see you with less than eight characters sometimes, but without trailing spaces or full stops, which might be bad.

Of course, a regex expression, or an improvement on the above, may be better. Perhaps remove the space etc. first;

RemoveCharacters(left(Clean([name]), 8), ., 3))

Or if you always want eight characters;

left(RemoveCharacters(Clean([name]), ., 3), 8)

Also, you may want to include other characters in the RemoveCharacters() command, such as ellipses (…) which are very bad at the end of a file name.



References. Read thoroughly and understand:
https://wiki.jriver.com/index.php/Rename,_Move,_and_Copy_Files
https://wiki.jriver.com/index.php/Expression_Language