How can I use PGN-Extract to split a multi-game pgn into separate files with just one game per file. With the pgn being named for the opponents? Like opponentA-opponentB.pgn

  • Best to email Kent, the author. He's quite responsive.
    – SmallChess
    Dec 19, 2018 at 3:44
  • As SmallChess says, as the author of pgn-extract, I am happy to field questions about the program via email and entertain ways to add additional features.
    – kentdjb
    Dec 19, 2018 at 7:16
  • should be able to write some parser in python relatively quickly that splits file and saves each with separate name
    – Drako
    Dec 19, 2018 at 14:16

1 Answer 1


To a limited extent, you can do something like this already using the -Tp argument which selects games by a particular player. So:

pgn-extract -TpLeko --output Leko.pgn games.pgn

but there is not currently (2018.12.19) a way to have the file names generated automatically from the contents of the source file. Without a way to bound the number of players of interest this would require a lot of file opening and closing for a large input file. Some thought would also need to be given to how player names are mapped to file names.

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.