INTERACT FORUM

Please login or register.

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

Author Topic: seperate expression  (Read 2214 times)

mcj008

  • Recent member
  • *
  • Posts: 35
seperate expression
« on: August 25, 2013, 04:28:15 am »

Hello, I have 17 expressions presets for "Rename,move and copy files" ofcourse they are all a bit different and I want to put them all into 1 expression...but when I do that the program outputs wrong. So what should I edit between expression lines to make the program read them like they are the single presets eventough they are glueed together  ?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: seperate expression
« Reply #1 on: August 25, 2013, 08:25:33 am »

Show your preset expressions.
Logged
The opinions I express represent my own folly.

mcj008

  • Recent member
  • *
  • Posts: 35
Re: seperate expression
« Reply #2 on: August 25, 2013, 10:43:11 am »

ifelse(isequal([Grouping],Album),Albums)\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Album [Best Of]),Albums [Best Of] )\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Album [Mixed]),Albums [Mixed])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Artist Compilation Series [UnMixed]),Artist Compilations Series [UnMixed])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Artist Compilation [UnMixed]),Artist Compilations [UnMixed])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Club Compilation Series [UnMixed]),Club Compilation Series [UnMixed])\Regex([Comment], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Series]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],DJ Compilation Series [Mixed]),DJ Compilation Series [Mixed])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Series]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],DJ Compilation Series [UnMixed]),DJ Compilation Series [UnMixed])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Series]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],DJ Compilation [UnMixed]),DJ Compilation [UnMixed])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],DJ Compilation [Mixed]),DJ Compilations [Mixed])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],EP [Incomplete]),EP's [Incomplete])\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],EP),EP's)\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Single),Singles)\Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album Artist]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Various Compilation Series [Mixed]),Various Compilation Series [Mixed])\Regex([Album], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Series]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Various Compilation Series [UnMixed]),Various Compilation Series [UnMixed])\Regex([Album], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Series]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Various Compilation [UnMixed]),Various Compilations [UnMixed])\Regex([Album], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]

ifelse(isequal([Grouping],Various Compilation [Mixed]),Various Compilations [Mixed])\Regex([Album], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #\, [R1])\[Album]\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: seperate expression
« Reply #3 on: August 25, 2013, 12:33:26 pm »

A couple of questions first:

1. Why are (most of) your Grouping phrases singular, but your output is plural - can the Grouping phrases just be plural to begin with so they can be output directly?

2. There is one segment that is use Comment - is that intentional?

3. What is the purpose if the Regex/Compare segment?

4. This portion seems incomplete: if(Compare(1[R1], >=, 10), #\, [R1]) - it is missing a comma (no else clause).  You're not getting errors?

5. For your various Series groupings, is it true that when a Grouping is not a series, Series will be empty (if so, this can collapse several path variants into one segment)?
Logged
The opinions I express represent my own folly.

mcj008

  • Recent member
  • *
  • Posts: 35
Re: seperate expression
« Reply #4 on: August 25, 2013, 01:14:14 pm »

A couple of questions first:

1. Why are (most of) your Grouping phrases singular, but your output is plural - can the Grouping phrases just be plural to begin with so they can be output directly?

Yes they can but when I have an album I edit the grouping field as "Album", not "Albums"...but the output will be the main map "Albums" on my disk

2. There is one segment that is use Comment - is that intentional?

Yes it is, I fill in the name of the Club.

3. What is the purpose if the Regex/Compare segment?

I dont know much about the code or for what it actuall is used for, it was trial and error for me..copy paste from this forum and googled...but it actually works for my stuff.

4. This portion seems incomplete: if(Compare(1[R1], >=, 10), #\, [R1]) - it is missing a comma (no else clause).  You're not getting errors?

no.

5. For your various Series groupings, is it true that when a Grouping is not a series, Series will be empty (if so, this can collapse several path variants into one segment)?

I dont edit "series" field when it is not a series...so it stays empty...i'm happy with the output.

this all works for me, but it could change with time
.


so all I want to do here is put them all in one expression field, and have the program recognize the groupings like when it is a single preset...is this possible???
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: seperate expression
« Reply #5 on: August 25, 2013, 02:32:14 pm »

Given you're responses, I'd go with something like this:

First, define the following three calculated user fields (the field names are on the left, expression on the right).  Feel free to change the names, but do so below as well.

Code: [Select]
_pathRE_Album_Artist:  Regex([Album Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #, [R1])
_pathRE_Album:         Regex([Album],        /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #, [R1])
_pathRE_Comment:       Regex([Comment],      /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), #, [R1])

Then, your expression can look like this:

Code: [Select]
ifelse(
isequal([Grouping],Album),                                                              Albums\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],Album [Mixed]),                                              Albums [Mixed]\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],Album [Best Of]),                                          Albums [Best Of]\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],Artist Compilation Series [UnMixed]),  Artist Compilations Series [UnMixed]\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],Artist Compilation [UnMixed]),                Artist Compilations [UnMixed]\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],DJ Compilation [UnMixed]),                         DJ Compilation [UnMixed]\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],DJ Compilation [Mixed]),                            DJ Compilations [Mixed]\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],EP [Incomplete]),                                         EP's [Incomplete]\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],EP),                                                                   EP's\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],Single),                                                            Singles\[_pathRE_Album_Artist]\[Album Artist],
isequal([Grouping],DJ Compilation Series [Mixed]),               DJ Compilation Series [Mixed]\[_pathRE_Album_Artist]\[Album Artist]\[Series],
isequal([Grouping],DJ Compilation Series [UnMixed]),           DJ Compilation Series [UnMixed]\[_pathRE_Album_Artist]\[Album Artist]\[Series],
isequal([Grouping],Various Compilation [UnMixed]),              Various Compilations [UnMixed]\[_pathRE_Album],
isequal([Grouping],Various Compilation [Mixed]),                  Various Compilations [Mixed]\[_pathRE_Album]\[Album],
isequal([Grouping],Various Compilation Series [Mixed]),     Various Compilation Series [Mixed]\[_pathRE_Album]\[Series],
isequal([Grouping],Various Compilation Series [UnMixed]), Various Compilation Series [UnMixed]\[_pathRE_Album]\[Series],
isequal([Grouping],Club Compilation Series [UnMixed]),       Club Compilation Series [UnMixed]\[_pathRE_Comment]\[Series]
)\[Year]\[Album]\[[Publisher]] [CAT_[Catalog #]]


This pulls out the common components, and uses one big switching IfElse().  I grouped them and used white space to line up the key elements so you can see how it all works.
Logged
The opinions I express represent my own folly.

mcj008

  • Recent member
  • *
  • Posts: 35
Re: seperate expression
« Reply #6 on: August 26, 2013, 09:46:10 am »

Hey, I have been strugling to get this going, but it seems I dont know where to put it all...I paste this all into the "move, rename & copy" expression field and it outputs wrong...is it an insert function of this menu I should select??
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: seperate expression
« Reply #7 on: August 26, 2013, 11:28:32 am »

Tools > Options > Library & Folders > Manage Library Fields...

Add New Field.  See Custom Fields.
Logged
The opinions I express represent my own folly.

mcj008

  • Recent member
  • *
  • Posts: 35
Re: seperate expression
« Reply #8 on: August 27, 2013, 01:30:12 pm »

I got it working MrC, just like I want it to work, thanks alot for your help!
Logged
Pages: [1]   Go Up