INTERACT FORUM

Please login or register.

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

Author Topic: Limiting # of chars in filename  (Read 1933 times)

enigman

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 95
  • thinking...
Limiting # of chars in filename
« on: May 19, 2006, 10:44:27 am »

Hi -

I was wondering if there was any way to use an expression to limit the number of characters in a filename scheme.  For example, I like to include as much information in the filename as possible, including the album title.  However, I've run into issues with paths that are too long because of this really lengthy filename (usually happens with annoyingly long album and/or song titles).  I want to be able to tell MC to truncate the album /song names at say 25 characters.  Possible?


Thanks!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42325
  • Shoes gone again!
Re: Limiting # of chars in filename
« Reply #1 on: May 19, 2006, 10:46:11 am »

MC's Rename From Properties will properly truncate filenames at the Windows filename limit of 260 characters.
Logged
Matt Ashland, JRiver Media Center

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re: Limiting # of chars in filename
« Reply #2 on: May 19, 2006, 10:50:27 am »

Quote
I want to be able to tell MC to truncate the album /song names at say 25 characters.  Possible?

why?

Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

enigman

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 95
  • thinking...
Re: Limiting # of chars in filename
« Reply #3 on: May 19, 2006, 11:00:13 am »

I don't just want to truncate the entire filename, since that runs the risk of cutting off a bunch of useful information.  I ideally want to individually truncate "sections" of the filename.  I use the following convention (pardon me if my fields aren't entirely accurate):

[album].[track #].[artist].[name]

Let's say I have a really long and annoying title:

This is the Album that never ends, yes it goes on and on my friend. Some people started singing it, not knowing what it was, and they'll continue singing it forever just because This is the Album that never ends, yes it goes on and on my friend. Some people started singing it, not knowing what it was, and they'll continue singing it forever just because

If I resort to letting MC truncate the entire filename, I'm going to cut out the rest of the useful information in the filename (track #, artist, and name), giving me a pretty useless filename.  However, if there's a way to selectively limit the characters in each tag that makes up the filename, then I can truncate the album individually from the rest of the elements in the filename, and keep the bulk of the useful information.

In addition, this would also come in handy when creating filenames that for system compatibility reasons need to be less than the windows limit - I've run into some weird issues before with filename lengths on Macs and when burning CDs.

Thanks!
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re: Limiting # of chars in filename
« Reply #4 on: May 19, 2006, 11:05:12 am »

So:

Paul Revere and the Raiders - Hungry mp3

and

Paul Revere and the Raiders - Birds of a Feather.mp3

will over write

Paul Revere and the Raiders - Hungry mp3 since what you want to do is cut it off at 25 chrs

so all songs from Paul Revere and the Raiders will be come

Paul Revere and the Raide.mp3
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42325
  • Shoes gone again!
Re: Limiting # of chars in filename
« Reply #5 on: May 19, 2006, 11:09:04 am »

In Rename From Properties, use:

Mid([Artist],0,25)

instead of just

[Artist]
Logged
Matt Ashland, JRiver Media Center

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re: Limiting # of chars in filename
« Reply #6 on: May 19, 2006, 11:13:40 am »

i thought he wanted to limit the file name lenth it's self to 25 chrs, and if thats true then i don't think there is a way.

Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re: Limiting # of chars in filename
« Reply #7 on: May 19, 2006, 11:21:18 am »

Acualy i just tested

Mid([Filename (name)],0,25)

and what ever the file name is will cut it off at 25chrs

so it did cut the file to

Paul Revere and the Raide.mp3

but you need to have something in the file name field first and what ever is there it will cut it off.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re: Limiting # of chars in filename
« Reply #8 on: May 19, 2006, 11:22:15 am »

Mid([Filename (name)],0,25) stored as an expression column

followed by

Library->Move/Copy from it to the actual Filename(name) field.

Why its not possible to just selectively abbreviate crazy long tracknames like that would be my suggestion. Can't possibly have 100s of tracks lwith names like that.

If you are open to alternatives, don't append album to the file name, what for, with MC, you dont really care what the filename looks like so long as MC knows where to find it.

My convention is [track#]-[artist]--[name]
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re: Limiting # of chars in filename
« Reply #9 on: May 19, 2006, 11:24:11 am »

I would never cut the file name unless it reached the windows limit


Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

enigman

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 95
  • thinking...
Re: Limiting # of chars in filename
« Reply #10 on: May 19, 2006, 12:07:00 pm »

I think Matt's solution will do what I want to do - I'll try that later today.

KingSparta, my idea was not to truncate the entire filename, but the specific components of the filename, for exactly the reason you brought up.  If I just truncate the entire filename (at the windows limit, or at the Joliet limit, or any other more restrictive limit), I run the risk of cutting off important information.  If I truncate the artist, album, or song name before putting them together as a filename, then I assure that most (if not all) of each piece of information is properly preserved.  To use your example, If I limit myself to the arbitrarily low value of 12 characters for each component  (just using 12 chars to easily demonstrate what I'm getting at):

Paul Revere and the Raiders - Birds of a Feather.mp3

becomes

Paul Revere  - Birds of a F.mp3

Which is much more useful than if I just limited the entire filename to 30 characters:

Paul Revere and the Raider.mp3


Logged
Pages: [1]   Go Up