INTERACT FORUM

Please login or register.

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

Author Topic: any way to create this filter?  (Read 1576 times)

steveklein

  • Galactic Citizen
  • ****
  • Posts: 478
any way to create this filter?
« on: February 05, 2009, 07:18:16 pm »

i want to create a filter that searches various fields and checks to see if the number of open parenthesees ( matches up with closed parenthesees )

i think this would help me identify files that are truncated
Logged

steveklein

  • Galactic Citizen
  • ****
  • Posts: 478
Re: any way to create this filter?
« Reply #1 on: February 08, 2009, 11:07:22 am »

anyone got an idea?
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: any way to create this filter?
« Reply #2 on: February 08, 2009, 01:14:21 pm »

I don't think this is currently possible.  As good as smartlists are you'd need something like regular expressions to do this and MC doesn't support them.

Cheers,

Mark
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8955
Re: any way to create this filter?
« Reply #3 on: February 08, 2009, 03:15:08 pm »

I tried to get you there using listcount.
The idea being that you create two calculated fields, one that counts opening, and one that counts closing parenthesis, then compare the two for equality using an isequal() expression.

While the theory is excellent, the practice is not.
This is because the listcount function is counting items against a given delimiter, (in this case, the parenthesis) not the delimiter itself, therefore, any closing bracket at the end of a given field is not counted, rendering the idea a bit of a cul-de-sac.

I wonder if it would work if you created a smartlist that lists all artists that contain an opening, another that lists all artists that contain a closing, and a third that lists tracks that are in the first list, but not the second?

-marko.

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: any way to create this filter?
« Reply #4 on: February 08, 2009, 03:24:45 pm »

nice, marco i was thinking the same and this is what i came up with .
if(IsEqual(ListCount([name]WE,/(),ListCount([name]WE,/)),2),good,bad)
by putting the WE after the name it seems to work.

 :)
gab
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: any way to create this filter?
« Reply #5 on: February 08, 2009, 04:03:21 pm »

Nice!

Mark
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8955
Re: any way to create this filter?
« Reply #6 on: February 09, 2009, 01:22:21 am »

Works as expected in a view scheme pane, but appears to be yet another example of the smartlist wizard mis-interpreting the string because, if you use:

[=IsEqual(ListCount([name]WE,/(),ListCount [name]WE,/)),2 ]=0

as a smartlist rule, the wizard changes it to:

[=IsEqual(ListCount([name]WE,/,ListCount [name]WE,/)),2 ]=0

stripping out the "()" when I press the OK button, leaving the escape character as the delimiter, and removing the parenthesis that closes the first listcount function ?

-marko.

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: any way to create this filter?
« Reply #7 on: February 09, 2009, 02:50:01 am »

"never trust a Wizard"
Logged
Pages: [1]   Go Up