INTERACT FORUM

Please login or register.

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

Author Topic: Limit filename length??  (Read 3713 times)

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Limit filename length??
« on: October 11, 2004, 06:24:41 pm »

Anyone know a way to limit the length of a file name to 59.3 characters max?  i'm trying to make sure all of my files can be played by quicktime, and that is the longes file it recognizes.

I don't know if there's any way to force MC to limit a filename to that length (automatically using a "(1)" or 2 as needed to stay under the limit.

I need to rename all of my files, convert them to m4a files (leaving the originals in tact), create a new Library (copied from the Default), open the new library, find/replace the extensions to m4a, find/replace the path with the correct path, and hopefully MC sees all the files, and I keep all of my tagging (including replay gain!!) in tact, just pointing to the correct aac files.

Anyone see any flaws in this plan?  Assuming I can limit my filenames to 59.3 characters max.

*edit*  After thinking on this for a few minutes, i thought if there was a way to create a new field and limit the length of that field, then I could just copy the artist to a field limited to 15 characters, and name to a filed limited to 37 chars and them rename the file based on those 2 fileds, then I'd know it was less than the 59 max, leave a few extra spaces for the divider ( - ) and for the "(1)" it might add.

Unfortunately, I don't know how to create this length limited field.  Maybe matt can whip me up something(s) real fast ;)
Logged
pretend this is something funny

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Re:Limit filename length??
« Reply #1 on: October 12, 2004, 04:13:29 pm »

How about some way to just simply identify any filenames that are too long.  I might be able to edit a few (hundred?) by hand, if there was an easy way to identify them.

A search in Windows explorer?  A freeware tool?
Logged
pretend this is something funny

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42053
  • Shoes gone again!
Re:Limit filename length??
« Reply #2 on: October 12, 2004, 04:15:50 pm »

What if you just rename from properties and use just [Name] or just [Track #]?
Logged
Matt Ashland, JRiver Media Center

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Re:Limit filename length??
« Reply #3 on: October 12, 2004, 05:34:48 pm »

I suppose I could do that, but name is often repeated with either different versions of a song, or maybe one artist does a remake.  Then I'd have a bunch of (1) (2) (3) etc.  It'll work, but a length limited field would be much easier.

Maybe you could also find it useful to do something like this behind the scenes to make aac playback/handling more robust in the rest of MC as well?  Then we both win, right?

Thanks for listening.

PS  I gotta do something soon.  I've calculated it'll take around 6-8 days to convert my whole library, and I leave in 3 weeks exactly.  That doesn't leave much time for me to screw it up first.

I'll make something work.
Logged
pretend this is something funny

paulr

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 527
  • nothing more to say...
Re:Limit filename length??
« Reply #4 on: October 12, 2004, 06:15:43 pm »

You could export your library to a CSV file and use the LEN function in Excel (or another spreadsheet) to return string length..  Then sort by length.  You could then use the LEFT function to return a specific number of characters...  Then concatenate  ~1, ~2, etc.

Not sure if there is a way to automate the renaming from a CSV file though.  It would at least let you copy/paste the results and rename fairly quickly.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42053
  • Shoes gone again!
Re:Limit filename length??
« Reply #5 on: October 12, 2004, 06:41:50 pm »

Maybe we can pass in the short filename to Quicktime.

We'll look into it.  Remind us if we forget.
Logged
Matt Ashland, JRiver Media Center

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Re:Limit filename length??
« Reply #6 on: October 12, 2004, 10:32:16 pm »

Maybe we can pass in the short filename to Quicktime.

We'll look into it.  Remind us if we forget.

Steve said it doesn't work.  :-[

I like the idea above of finding string length above, althouth I don't know how to export as a CSV file (or import from one)

I'm willing to put forth some work into this, I just don't want to do any more than necessary.
Logged
pretend this is something funny

paulr

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 527
  • nothing more to say...
Re:Limit filename length??
« Reply #7 on: October 12, 2004, 10:58:36 pm »

To export, just add your library to Playing Now, File > Export Playlist (ASCII Delimited, All or Visible fields depending on if you have filename showing, All).

It's actually not technically CSV (it uses the pipe  |  character).  Once inside Excel, just tell it to open the file and a box should pop up to ask how to split up the columns.  Choose Delimited and select the pipe character (or type it in if its not a choice).

Then you can just setup forulas for the LEN and LEFT functions...  If you need help, just PM or email me (if you still have my address)...

Hope this helps.

Paul
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Re:Limit filename length??
« Reply #8 on: October 13, 2004, 12:00:58 am »

It does!  i'll try it tomorrow, when I'm not so tired.
Logged
pretend this is something funny

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Re:Limit filename length??
« Reply #9 on: October 15, 2004, 11:18:18 am »

It works great.  It'll be easy to do on my entire library, once it's all cleaned up.

Only problem I see is...there's no import feature.  How do I get the corrected data back into the Library?

I'm so close to a solution, any ideas?
Logged
pretend this is something funny

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re:Limit filename length??
« Reply #10 on: October 15, 2004, 11:45:10 am »

You could use MPL import if you can export your data in that format, but it doesn't change the filenames on HD. (http://yabb.jriver.com/interact/index.php?board=3;action=display;threadid=24043).

You mentioned about few hundred files. How about copy-pasting the filenames from the Excel sheet to the MC library. I have managed to do that without mouse using Ctrl+V, Alt+Tab, F2, Ctrl+P and arrow keys. It is quite fast after some practicing.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

BullishDad

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 398
  • nothing more to say...
Re:Limit filename length??
« Reply #11 on: October 15, 2004, 03:48:43 pm »

Justin, this may be a little late, but here goes anyway.

I once used a program called Bulk Rename Utility to reduce the length of filenames.  It was pretty easy to use and gives you lots of options.

Link to http://www.bulkrenameutility.co.uk/Main_Intro.php
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Re:Limit filename length??
« Reply #12 on: October 15, 2004, 04:13:13 pm »

BullishDad, thanks for the link.  It might do what I want.  I'm looking at it now.

Alex, can you tell me more about MPL import/export.  I can get the data into excel, and change it to my liking quite easily, but I don't know what to do with it after that.  How do i get it into MPL format?

I don't want to actually change the filenames outside of MC.  i just want to limit the length of the name and artist fields (by creating new, similar fields that have a max # of characters), so when I tell MC to rename from properties, I can select the new limited fields to rename from, and I know the new filename will be short enough.

I'm just having trouble getting the excel info back into MC.  Anyone with any advice on this, i will appreciate it.

I will work on the program BullishDad pointed out while I wait for a reply.

Thanks everyone.
Logged
pretend this is something funny

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re:Limit filename length??
« Reply #13 on: October 15, 2004, 05:37:09 pm »

If you are familiar with Excel I think you can organize your data in this way:



Next steps are quite simple:
Save it to plain text format.
Remove tabulators, e.g. in MS Word (replace ^t with nothing.)
Save again to plain text.
Rename to .mpl
Import to MC.

You must first delete the files from the MC library, otherwise it won't import the same tracks again. So keep your library backup in a safe place. An MPL file can include all library fields, so you won't loose anything if all data you need is included in the Excel file.

There is more about importing .mpl files in the link I gave earlier. I think MC10 imports .mpl files faster than MC11, but I can be wrong with this. I have not tested them side by side and I did that with MC10 months ago.

Edit

Excel seems to add some extra quotation marks to the text file. So something like this is also needed: replace "< with <, replace "" with " , etc.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3273
  • Getting older every day
Re:Limit filename length??
« Reply #14 on: October 16, 2004, 11:35:07 pm »

Alex, your picture is gone.

Can you tell me what you used as the delimiter, or what method you used to split the data into the columns from the pic you originally posted?

I finally have my library mostly tagged the way i want.  I'm now ready to export the MPL file, and try the manipulation.  I couldn't find any easy/obvious way to force MC to export all fields (or even ones I specify), and it it doesn't export the same number of fields for every file, then it'll be impossible to shorten the fields I want, since they won't be evenly spaced (row to row).  Do you know of a way to force a known number of fields for every file?

Thanks again for your help.

If not, does anyone know a way to export my library as an excel file (one file/row), and more importantly, re-import that file back to MC?
Logged
pretend this is something funny

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re:Limit filename length??
« Reply #15 on: October 17, 2004, 09:59:13 am »

Alex, your picture is gone.

Must have been network congestion, because it shows fine now (the www-server is not on my ISP's network, so I should see the problem too). Here is the example Excel file: mpl.xls.

Quote
Can you tell me what you used as the delimiter, or what method you used to split the data into the columns from the pic you originally posted?

Actually, I understood that you already had all necessary data fields in an Excel spreadsheet and you were asking a way to import it back to MC. My method is good for small amounts of data, but perhaps not for thousands of entries. I am not very skilled with spreadsheets and databases, but arranging an Excel table to that output format should be a peace of cake for someone who knows better. Basically that should be a report printout in a given form. MS Word has a merging tool for address labels etc. It can import data fields from Excel sheets. Maybe that could be used.

Quote
I finally have my library mostly tagged the way i want.  I'm now ready to export the MPL file, and try the manipulation.  I couldn't find any easy/obvious way to force MC to export all fields (or even ones I specify), and it doesn't export the same number of fields for every file, then it'll be impossible to shorten the fields I want, since they won't be evenly spaced (row to row).  Do you know of a way to force a known number of fields for every file?

The fields must be populated. Otherwise they are not included. By arranging your view and exporting only the visible fields you can limit the amount of the fields.

Quote
If not, does anyone know a way to export my library as an excel file (one file/row), and more importantly, re-import that file back to MC?

A simple copy-paste will do the export part. Select all -> copy -> paste to an empty Excel sheet. For some reason copy-pasting 21885 files at once is too much for my PC - nothing gets pasted, but e.g. in chunks of 1000 it works. As far as I know the only way to import is by MPL files.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755
Pages: [1]   Go Up