A CLI program for manipulating PGN fileshttps://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/
This is a command-line program for manipulating chess games recorded
in the Portable Game Notation (PGN).
Extracted games may be written out either including or excluding
comments, NAGs, variations, move numbers, tags and/or results.
Games may be given ECO classifications derived from the accompanying
file eco.pgn, or a customised version provided by the user.