I am trying to filter out games played by one specific player out of a large pgn file, currently my tags file looks like this:

WhiteElo >= "2500"
WhiteElo <= "2600"
BlackElo >= "2500"
BlackElo <= "2600"
TimeControl >= "180"
Player <> "BOT-RENAMED"

But the resulting file does include "BOT-RENAMED", am I doing anything wrong?

Alternatively, can we exclude games where the lichess tag WhiteTitle or BlackTitle are "BOT"?

1 Answer 1


The relational operators are intended to be used with numeric values. However, it would make sense to allow <> to be applied to non-numeric tags.

You can get around this limitation in your particular case by making two passes over the games. On the first pass, select on the basis of all the tags apart from the Player one. Then make a second pass where you just match the BOT-RENAMED player. If on this second pass you also use the -n option then pgn-extract will save all the non-matched games (i.e., those not by BOT-RENAMED) to a separate file. That file should then contain the ones you want overall.

  • Hello David! Thank you very much for your answer, it does indeed solve my problem. I will try to remember the -n <file> argument. Have a great day!
    – Purefan
    Commented Nov 12, 2023 at 22:11
  • Excellent! I am glad you were able to make use of that.
    – kentdjb
    Commented Nov 13, 2023 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.