INTERACT FORUM

Please login or register.

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

Author Topic: need expression help - separating a field  (Read 1515 times)

Listener

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1084
need expression help - separating a field
« on: October 21, 2006, 04:56:48 pm »

I have multiple versions of the same work played by the same artists.  I added distinguishing info in parens after the work name and placed this in the album tag.  For example,

Symphony No. 40 (from vinyl)
Symphony No. 40 (Sony disk)
Symphony No. 40 (set)

Now, I like to separate these strings into the actual work name to be stored in a "Work" field and version info to be stored in a "Version" field.  Everything to the left of the '(' goes into the "Work" field and everything inside the parens goes into the "Version" field.  (If it is not easy to remove the parens, I can like with them in the version field.

I've looked at the DB expressions page (http://www.jrmediacenter.com/DevZone/DBExpressions.htm) and see the MID() function.    However, I don't see anything to return the position of a character or string in a string.

I searched this forum for threads about expressions.  I didn't find anything that solved my problem.

I also looked at the "Smartlist & Search Rules & Modifers" page in the MC 11 help.  I don't understand whether this language can be used to form new expressions.

I'd appreciate tips or a pointer to a previous thread that provides a solution to my problem.

Bill

Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: need expression help - separating a field
« Reply #1 on: October 22, 2006, 06:50:22 am »

You're looking for the same thing as Bartman01 was in this thread: http://yabb.jriver.com/interact/index.php?topic=36140.0 but with a slight difference.

You're problem can be sorted. It does mean going around the block a few times, but the tasks are quite simple to follow. I've made the assumption that your [album] field only contains [work] and [version] info, and that none of the [work] info contains parens:

1. Gather together all the files that contain [Version] info using the following search string: [media type]=audio [=isequal([album],/ /(,8)]=1

2. Click on the little wizard arrow in the left end of the search box, then click on 'album'. In the dialogue that shows, go through the list and place ticks beside any albums that contain parens, but don't contain [Version] info, and then, at the bottom, change the "Include" to "Exclude" and then click OK. (These are the files you will be working with. You might want to add them to a new playlist so that if you make a boo-boo later on, you can still list them in one place for fixing.

3. Right click on a single file and choose "Library Tools > Rename files from properties". Untick Directory, and place [Album] in the Filename field, then click OK.

4. Right click on the same file again. Choose "Library Tools > Fill properties from filename", Directory should still be unticked, place [work] ([version]) in the filename field, then click OK

5. Right click on the same file again. Choose "Library Tools > Rename files from properties", Directory should still be unticked, place whatever is required in the filename field to return the filename to what it was before you started, then click OK.

If those steps get you what you want, select all of the files in the list and repeat steps 3 to 5.

(the only other step you may need to do is check for illegal filename characters. if any of your [work] or [version] information contains things like double quotes, question marks, back or forward slashes, these will be replaced by underscores using the above process)

Listener

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1084
Re: need expression help - separating a field
« Reply #2 on: October 23, 2006, 12:39:51 am »

Marko,

Thanks for the quick and detailed reply.  I understood your decription but I was a bit leery of renaming files back and forth.  My file names are built from a series of fields as Composer_Album_Artist_Name_Track #.flac. My classical music is stored in folders by Composer name so there are lots of files in each folder for the same work.  If I simplify the file name, I run the risk of having file name collisions.

I wound up using a combination of seaching, selecting with the panes lists, editing in the tag window and doing search and replace.  It took 2-3 hours work including adding new sub-genre tag info.

Bill
Logged
Pages: [1]   Go Up