PGN-Extract: Portable Game Notation (PGN) Manipulator for Chess Games by David J. Barnes
This file documents a program to extract selected games from a PGN format data file. There are several ways to specify the criteria on which to extract: textual move sequences, the position reached after a sequence of moves, information in the tag fields, and material balance in the ending. Full ANSI C source for the program is available under the terms of the GNU General Public License. The program includes a semantic analyser which will report errors in game scores and it is also able to detect duplicate games found in one or more of its input files.
The range of input move formats accepted is fairly wide and includes recognition of lower-case piece letters for English and upper-case piece letters for Dutch and German. The default output is in English Standard Algebraic Notation (SAN), although there is some support for output in different notations.
Extracted games may be written out either including or excluding comments, NAGs, and variations. Games may be given ECO classifications derived from the accompanying file eco.pgn, or a customised version provided by the user.