INTERACT FORUM

Please login or register.

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

Author Topic: Renaming files with short names?  (Read 900 times)

stumpygremlin

  • World Citizen
  • ***
  • Posts: 121
Renaming files with short names?
« on: June 27, 2018, 10:53:41 pm »

Is it possible to rename my music files with the following structure:
D:\Music\Albums\
  • \[Artist] - [Album]\xxxxxxxx.mp3

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?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Renaming files with short names?
« Reply #1 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.


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

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Renaming files with short names?
« Reply #2 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
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner
Pages: [1]   Go Up