Skip to main content
Topic: Literal double quotes in query syntax (Read 193 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Literal double quotes in query syntax

Double quotation marks are a special character in foobar2000 query syntax, so how can I compare a metadata field with a string that includes literal double quotes? For example what should the query expression be in order to return all library items where the artist is Richard "Groove" Holmes?
I'm late

Re: Literal double quotes in query syntax

Reply #1
Going out on a guess here but did you try $char()? For " it's $char(34). So perhaps Richard "$char(34)"Groove"$char(34)" Holmes.

Re: Literal double quotes in query syntax

Reply #2
Going out on a guess here but did you try $char()? For " it's $char(34). So perhaps Richard "$char(34)"Groove"$char(34)" Holmes.
I just tried your suggestion and I got an "invalid filter expression" warning.
I also tried "$char(34)Groove$char(34)" which did not trigger the warning, but still no items were returned.
I'm late

Re: Literal double quotes in query syntax

Reply #3
Enclose the query in single quotes? Try
'Richard "Groove" Holmes'
and see what you get?


Re: Literal double quotes in query syntax

Reply #5
This works:
Code: [Select]
"$if($strstr(%artist%,$char(34)),1,0)" IS 1


 

Re: Literal double quotes in query syntax

Reply #7
Interesting what hits I get if I follow my own tip up there ... of course, precisely the query I entered, returned the right hits :-/   But
' "A" Train'
does not return any Take the "A" Train. Why it returns the track it does return, beats me.

Re: Literal double quotes in query syntax

Reply #8
Double quotation marks are a special character in foobar2000 query syntax, so how can I compare a metadata field with a string that includes literal double quotes? For example what should the query expression be in order to return all library items where the artist is Richard "Groove" Holmes?
You do know that you can just enter:

Richard Groove Holmes

And it will return Richard "Groove" Holmes. If you leave out the ", it will just match the words, which works just fine for me. It doesn't need the exact string.

Mike

Re: Literal double quotes in query syntax

Reply #9
You do know that you can just enter:

Richard Groove Holmes

And it will return Richard "Groove" Holmes. If you leave out the ", it will just match the words, which works just fine for me. It doesn't need the exact string.

Yes, but that compares the search keywords with all metadata fields, which would return, for example, tracks where Richard Groove Holmes is just a sideman, or the composer.
I'm late

 
SimplePortal 1.0.0 RC1 © 2008-2018