More > JRiver Media Center 21 for Windows

Tag manipulation with expression language

<< < (2/3) > >>

jacobacci:
Hi guys,
I'm very sorry I didn't answer before, but somehow my new post notification seems to have been turned off.
Thanks a lot for your answers. It is much clearer to me no how JRiver expressions can be used. I am used to work with selecting a group of files from a smarlist or other selection method. Realizing that I can enter the expressions into the "alt-enter" tag fields is the key insight from your hints - that's where I was stuck.
I will try the JRiver expression method and let you know how it went.
BTW what I want to achieve is the following for all the album tags in the given selection of files:
D_The_Great_File_1 should be changed to DSD_The_Great_File_1
DSD_The_Great_File_2 should not be modified.

ferday:
are the files named consistently?

so, are they ALL D_album1_1, D_album1_2, D_album2_1, D_album2_2.........

is there ever more than 2 (D_album1_3)?  is the last character in the album name ALWAYS a number?

the expression engine (regex or MC) will need a pattern to match!  so we need to know where the pattern stops to be able to change one but leave another...


--- Code: ---ifelse(isequal(right([Album],1),1,5),[Album],isequal(left([Album],2),d_,1),replace([album],D_,DSD_))),[Album]
--- End code ---

i haven't test the above, but in theory it should start by testing for a number great than 1 as the LAST character in the album name, and if so it ignores it.  if it is 1, it should then move on to replace the D_ with DSD_
i'll try to test it when i have time but in the meantime, you need to let us know how the albums are actually named.

edit:  thanks blgentry, figured you'd have it quick

blgentry:

--- Quote from: jacobacci on August 26, 2015, 05:27:57 am ---BTW what I want to achieve is the following for all the album tags in the given selection of files:
D_The_Great_File_1 should be changed to DSD_The_Great_File_1
DSD_The_Great_File_2 should not be modified.

--- End quote ---

If you just want to change the album tags like that, you can use my expression with a tiny modification:


--- Code: ---=if(compare(regex([Album], /#^D_(.+)$#/,0,0), =,1), DSD_[R1], [Album])
--- End code ---

You keep mentioning file names, and they are sometimes important.  Do you want to change the [Album] tag, the actual filename on disk or both?

Brian.

dtc:
You can just start with a compare of the first 2 characters of the album name to D_, as ferday did in his expression. That would eliminate any problems with D_ occurring later in the album name. If you are looking at the filename, you can look for \D_.

Regex is a powerful tool, but as the old expression goes it is "indistinguishable from line noise".

jacobacci:
Sorry if I was not clear. Let me try again.

I have converted all my SACD ISOs to FLAC files. All the original SACD ISOs have an album tag of D_this_is_a_great_album (Abbey Road or whatever)
After the conversion all the resulting FLAC files have the same album tag as the original SACD ISO, namely D_this_is_a_great_album.
I then want to change the album tags of the FLAC files to DSD_this_is_a_great_album. Filenames etc. should not be changed.
When I convert more SACD ISOs in the future they will have album tags of D_this_is_a_great_album. Now I want to run the album name change expression on the directory with all the converted FLAC files.
All files that have an album tag of DSD_this_is_a_great_album should not be changed (they have had their DS added in front of the album name before). All files that have an album tag of D_this_is_a_great_album should have a DS added in front of the album name.

I think I see how ferday's expression works. It checks the first two characters of the album name. If they are D_ it adds DS in front. If they are not D_ it does nothing.

However when I selected a few files and pasted ferday's expression into the "alt enter" album field, the album tag seems to have been populated with the expression. It does not look like the expression did its work on the files.

Sorry if I am being difficult.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version