metadataAny PGN game has associated metadata: data about the game other than the moves played. CQL has various filters for accessing this metadata: elo, event, gamenumber, player, result, site and year.
Each of these filters has associated command line options as well to allow for games to be filtered
by particular values of the associated metadata. The command line option is the name of the filter preceded by the
The option is followed by a range (in the case of numeric metadata) or a string in the other cases.
For example, to limit games to those where Kasparov played, use:
cql -player Kasparov foo.cql
Note that all Kasparov games can be extracted into the file
kasparov.pgn without using
a CQL file as follows:
cql -player Kasparov -o kasparov.pgn -i database.pgn -silent
Here, database.pgn is the name of the PGN database to search.
To extract game 10 into the file
cql -gamenumber 10 -i database.pgn -o game10.pgn -silent