Skip to main content

Topic: Literal double quotes in query syntax (Read 179 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • davideleo
  • [*][*][*][*]
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

  • jazzthieve
  • [*][*][*][*]
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.

  • davideleo
  • [*][*][*][*]
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.
  • Last Edit: 22 November, 2017, 01:27:15 PM by davideleo
I'm late

  • Porcus
  • [*][*][*][*][*]
Re: Literal double quotes in query syntax
Reply #3
Enclose the query in single quotes? Try
'Richard "Groove" Holmes'
and see what you get?

  • davideleo
  • [*][*][*][*]
Re: Literal double quotes in query syntax
Reply #4
Enclose the query in single quotes? Try
'Richard "Groove" Holmes'
and see what you get?

Also no items returned.
I'm late

  • Daeron
  • [*][*][*][*][*]
Re: Literal double quotes in query syntax
Reply #5
This works:
Code: [Select]
"$if($strstr(%artist%,$char(34)),1,0)" IS 1

  • davideleo
  • [*][*][*][*]
Re: Literal double quotes in query syntax
Reply #6
This works:
Code: [Select]
"$if($strstr(%artist%,$char(34)),1,0)" IS 1

Thanks!
I'm late

  • Porcus
  • [*][*][*][*][*]
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.
  • Last Edit: 22 November, 2017, 02:53:02 PM by Porcus

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

  • davideleo
  • [*][*][*][*]
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