INTERACT FORUM
More => Old Versions => Media Center 13 (Development Ended) => Topic started by: steveklein 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
-
anyone got an idea?
-
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
-
I tried to get you there using listcount (http://wiki.jrmediacenter.com/index.php/Media_Center_expression_language#ListCount.28....29:_Use_to_return_the_number_of_items_in_a_delimited_list).
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.
-
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
-
Nice!
Mark
-
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.
-
"never trust a Wizard"