4

How can I use pgn-extract to remove a game from a pgn file when there is an illegal move?

Brian Towers
  • 96,800
  • 11
  • 239
  • 397
leo
  • 41
  • 1

1 Answers1

8

pgn-extract will do exactly that if you give it an input file and say where you want the correct games to go. For instance:

pgn-extract --output clean.pgn games.pgn

will put only the valid games from games.pgn into clean.pgn, reporting any errors on standard output. If you want to have a record of the errors then you can use the -l flag to specify a log file; e.g.:

pgn-extract --output clean.pgn -lissues.txt games.pgn

There are lots of additional options/flags described in the documentation.

Disclosure: I am the author of pgn-extract.

kentdjb
  • 1,781
  • 11
  • 14