INTERACT FORUM

Please login or register.

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

Author Topic: Identifying tracks with fields containing > 64 characters  (Read 926 times)

amargolis

  • Junior Woodchuck
  • **
  • Posts: 61
Identifying tracks with fields containing > 64 characters
« on: September 30, 2020, 11:31:39 am »

Any clever ideas how to design a view or playlist that will show me all tracks where the "name" or "artist" or "album" (or other) fields contain more than 64 characters? I need to export some files to a legacy media player that has a character limit of 64 characters in any given field. And then, once identified, how to truncate the fields down to 64 characters? Thanks in advance!
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Identifying tracks with fields containing > 64 characters
« Reply #1 on: September 30, 2020, 01:02:50 pm »

This can be done for specific fields, by listing the field names in an expression. You could do as many specific fields as you like this way.

You cannot check the length of all fields (any field) all at once, generically, without explicitly listing each field.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Identifying tracks with fields containing > 64 characters
« Reply #2 on: September 30, 2020, 01:16:46 pm »

So as an example to do it explicitly, modify a view, click set rules for file display, click the import/export button, and paste this in the dialog

([=compare(length([Name]),>=, 64)]=1 or [=compare(length([Artist]),>=, 64)]=1)

Then click OK on all the dialogs to close them and modify the view.

The view will now include only files where either the Name or the Artist is longer than 64 characters.
You can add or remove fields from consideration by modifying the expression. To do one at a time, it would just look like this:
[=compare(length([Name]),>=, 64)]=1

and you replace "Name" with whatever field you want to test.

To do more than those two at once, keep adding in at the end (between the parenthesis) more clauses beginning with or, changing the field name each time. Like this:
([=compare(length([Name]),>=, 64)]=1 or [=compare(length([Artist]),>=, 64)]=1 or [=compare(length([Album]),>=, 64)]=1)

To truncate, select all the files you want to modify by using a shift click on the field you want to truncate. So for example, click the first file, scroll to the end of the list, and shift-click on the Name column of the last file. This will select all files in between.
Tap the F2 key.  You are now editing that field for all files.
Enter the following
=Left([Name],64)

And all the Name fields will be instantly truncated to 64 characters.  So be very careful.  Ctrl-Z to undo.

You might want to make a library backup first if you aren't confident you know what you're doing.

So to sum up, you can search against multiple fields at once, but not all. You can truncate one field at a time.

I'm unsure why this is necessary: if the player has a limit of 64 characters, doesn't it essentially truncate long fields for you by not displaying anything longer, making all of this redundant?  Or does it barf and refuse to import tracks with long fields? That would be pretty lame.

Good luck.
Logged

amargolis

  • Junior Woodchuck
  • **
  • Posts: 61
Re: Identifying tracks with fields containing > 64 characters
« Reply #3 on: September 30, 2020, 02:54:33 pm »

@wer thank you so much for this. Extremely helpful and does just what I needed.

Yes, the software that these files will be imported into has some pretty major deficiencies including this issue.

Much appreciated!
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2565
Re: Identifying tracks with fields containing > 64 characters
« Reply #4 on: September 30, 2020, 03:35:41 pm »

If you're exporting the playlist to a file to then import it on that software, it may be easier to export it to CSV (with all fields or just the ones you want), load it into Excel and use a formula to check and truncate the fields. Then generate the new/clean playlist from the XLS/CSV output, or just re-import into an empty library in MC.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Identifying tracks with fields containing > 64 characters
« Reply #5 on: September 30, 2020, 04:09:01 pm »

That's a good idea for playlist data, but it seemed to me his issue was with the tags in the files themselves, that the player can't digest them properly.  So after modifying the CSV you would still need to reintegrate the updated tags into the files.

But that actually gives me another idea, where you can ignore the idea of playlists.

You can copy/paste between MC and Excel:

Setup a view with columns showing all the fields you want.
Select all the files and hit Ctrl-C
In Excel, Ctrl-V to paste all the data.

You can now edit and mess about as you like.

Then you can highlight the modified tags, and in MC, right-click and select Edit Commands->Paste Tags

That will show you a dialog asking which tags you want to paste.

You'd better experiment on small batches first.

Good luck...
Logged

amargolis

  • Junior Woodchuck
  • **
  • Posts: 61
Re: Identifying tracks with fields containing > 64 characters
« Reply #6 on: September 30, 2020, 04:56:06 pm »

Understood. Thanks to both of you for your helpful suggestions.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Identifying tracks with fields containing > 64 characters
« Reply #7 on: September 30, 2020, 05:36:22 pm »

No problem, glad to help.
Logged
Pages: [1]   Go Up