INTERACT FORUM

Please login or register.

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

Author Topic: Now, how about trailing numbers?  (Read 696 times)

kr4

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 740
Now, how about trailing numbers?
« on: October 14, 2021, 06:01:32 pm »

It is great to have the ability to clean up tags by removing leading numbers from names, it would also be useful to have one that removes trailing numbers.  I get many files with the track time appended to each name.
Logged
Kal Rubinson
"Music in the Round"
Senior Contributing Editor, Stereophile

terrym@tassie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 504
Re: Now, how about trailing numbers?
« Reply #1 on: October 14, 2021, 09:22:33 pm »

Could you give an example of the format(s) that you have? Is it something like 'My latest track - 03:04'
Logged
Good manners cost nothing.
Bad manners can cost you your reputation
― B.D.Hawkey

kr4

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 740
Re: Now, how about trailing numbers?
« Reply #2 on: October 14, 2021, 09:27:49 pm »

Could you give an example of the format(s) that you have? Is it something like 'My latest track - 03:04'
Yes, it is that or 'My latest track (03:04)'
Logged
Kal Rubinson
"Music in the Round"
Senior Contributing Editor, Stereophile

terrym@tassie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 504
Re: Now, how about trailing numbers?
« Reply #3 on: October 14, 2021, 10:55:26 pm »

EDITED original post for clarity. (15 October 12:45am)

This is working for me using your two examples, the regex may need refining if it throws up false positives in your library.

To find files with trailing duration suffixes, create a Smartlist, name it something meaningful then use Import/Export and paste the following into the Smartlist rules data window:
Code: [Select]
[Media Type]=[Audio] [=Regex([Name],/#(\s\(?\-?\s?\d+:\d+\)?)$#/,0)]=1
To 'clean' already imported files paste the following into the Name tag in the Tag Window:
Code: [Select]
=Replace([Name],Regex([Name],/#(\s\(?\-?\s?\d+:\d+\)?)$#/,1),)
To 'clean' files as they are imported use auto-import as described in this post here: https://yabb.jriver.com/interact/index.php/topic,130173.msg907787.html#msg907787
BUT paste the following into Value field:
Code: [Select]
Replace([Name],Regex([Name],/#(\s\(?\-?\s?\d+:\d+\)?)$#/,1),)

EDIT: Superseded (with breathtaking speed) by in-built MC functions - see Matt's post below.
Logged
Good manners cost nothing.
Bad manners can cost you your reputation
― B.D.Hawkey

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Now, how about trailing numbers?
« Reply #4 on: October 15, 2021, 07:54:22 am »

I'll work on these two today:
NEW: Added modes 7 and 8 to the Clean(...) expression to remove numbers from the end of the string ( 7 ) or either side of the string ( 8 ).
NEW: Added removing leading and trailing numbers to the Clean File Properties tool.

Thanks for the suggestion!
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up