Anyone familiar with the program pgn-extract to possibly help with a little troubleshooting? I have tried to look through manual of the program and I am coming at a loss with addressing the issue. I have tried using pgn-extract program commands -C, -N, -V with no affect. Here's the following line from my .bat file.

enter image description here

https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html for manual reference.

Objective-I am trying to clean up a .pgn file that was created by combining multiple .pgn files together via either dos commands.

copy *.pgn newfile.pgn


copy /b *.pgn newfile.pgn

Issue-.pgn code errors. In both attempts at combining multiple .pgn files I get similar errors. See screenshots.

improper header spacing examples(text editor used is Brackets). This is causing a variance in multiple GUI's calculation of total games in the database. Preferred fix would be to use pgn-extractor to clean the pgn file by properly placing the header of the next game in the proper position below the previous game so the GUI can correctly count total games. I know how to manually fix this but I'm also building a separate opening book that will have a thousands of games in and in case this issue happens with that, would like to find a fix beforehand.

enter image description here

enter image description here

  • 1
    I note that your bat file has -Y rather than -V, which would be an error as there is no -Y argument to pgn-extract.
    – kentdjb
    Feb 5, 2018 at 21:30

2 Answers 2


I am the author of pgn-extract. It would be easier to address the specifics of what you are trying to do via the personal email address included with the pgn-extract documentation. I would be happy to help.



I don’t know if pgn-extract can do that, but you might want to try sed. Use sed to do a global replacement for [Event, insert a new line to the beginning of the string.

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.