Answers.Body: <p>Have you tried Scid? I tested your pgn on Scid v. 4.7.0 (Database/Import File(s) of PGN games...) and these are the results:</p>
  <ol>
  <li>When importing the game it provides the following message:</li>
  </ol>
  <blockquote>
  <p>Importing from test.pgn...</p>
  <p>Imported 1 game.</p>
  <p>PGN errors/warnings:</p>
  <p>(game 1/line 6) Invalid Result tag: ?</p>
  <p>(game 1/line 8) Error parsing the tag pair FEN &quot;&quot;</p>
  <p>(game 1/line 9) Failed to parse the move: Bxf6</p>
  <p>(game 1/line 10) End of game, ignored the part after the last error.</p>
  </blockquote>
  <ol start="2">
  <li>And this is the parsed game:
  <a href="https://i.sstatic.net/Esbfw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Esbfw.png" alt="enter image description here" /></a></li>
  </ol>
  <p>Not perfect, but better than Caissa and LiChess. And if you have a bunch of games to import, it doesn't crash and tells you which ones are buggy.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-03T08:11:40.603Z
Answers.Text: Batch will definitely come in handy (although ChessPad already can do that too). I ACKed the answer; even if Andrew's solution is the best at the end...I just hate Java :-)
Answers.UserDisplayName: Hauke Reddmann
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-01T19:20:42.217Z
Answers.LastActivityDate: 2022-06-01T19:20:42.217Z
Answers.UserDisplayName: lodebari
Body: <p>I'm scanning old club zines. Apart from a colleague of mine who has the habit of hübnering up nested annotations with a mix of {[()]} (if done correctly, this should be no problem for PGN standard, since {} defines a comment regardless of additional brackets) there is also easily a ( mistaken for { in OCR or the other way round, or I forget to change () (in the zine) to {} or vice versa.</p>
  <p>Here is a random example of a bug from today:</p>
  <pre><code>[FEN &quot;&quot;]  
  1. d4 Nf6 2. g3 c5 3. c3 cxd4 4. cxd4 d5 5. Nc3 Bf5 {comment} 6. Qb3 Nc6 7. Nf3 {comment} 7...Na5 8. Qa4+ Bd7 9. Qd1 {comment) 9...e6 10. Bg2 Bd6 11. O-O O-O 12. Ne5 {comment} 12...Rc8 {comment) 13. Bg5 Nc4 {comment} 14. Bxf6 gxf6 15. Nxc4 Rxc4 16. e4
  </code></pre>
  <p>As you observe, two closing ) should be }. (Spotted them <em>both</em> in the source code?)</p>
  <p>Here are some options I already tried:</p>
  <ul>
  <li>My usual PGN software is ChessPad, which said &quot;Bxf6 illegal move&quot;. But the error happened far before that.</li>
  <li>Caissa Online PGN (my other favorite tool) gives total nonsense.</li>
  <li>Lichess doesn't accept it at all.</li>
  <li>I'm too lazy at the moment to write a Python parser.</li>
  <li>Brian (comment below) suggested &quot;abusing&quot; the CSE PGN tool. Guess what, indeed it barfs exactly where it should (at the first error), and would be a viable option if I can't find the bug. I'm still not happy with writing a &quot;fake&quot; question just to parse my PGN files.</li>
  </ul>
  <p>Thus I would like you to suggest good standalone PGN software which nails down the error(s) in buggy PGNs exactly where it happens, as the CSE parser seems to do. This includes illegal moves due to typos, which are also frequent. (Clearly, this is tricky: a naive approach in the given example might pair the first closing bracket with the one still open after Qd1, and thus find as &quot;next&quot; move 12...Rc8 and protest there.)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-01T09:27:06.643Z
Comments.Text: The Chess.SE replayer is JavaScript: https://cdn.sstatic.net/Js/webpack-chunks/58.c50238aa2ecc974aec89.en.js - in theory you could unminify that and run the relevant parts on your own (and even adjust it).
Comments.UserDisplayName: Glorfindel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-02T20:40:39.013Z
Comments.Text: To add to what @Glorfindel said, the replayer is based on my project here:
  https://github.com/andrewphoy/chess-replayer
Comments.UserDisplayName: Andrew
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-03T08:07:14.700Z
Comments.Text: @Andrew: Ah, THX. I give it a look. If it manages to always pinpoint the first error (which is of the dimension P=NP :-), that would be perfect.
Comments.UserDisplayName: Hauke Reddmann
Tags: <software><pgn><recommendations>
Title: What is a good PGN software for dealing with buggy PGN files?
ThreadText: # What is a good PGN software for dealing with buggy PGN files?
  
  (Asked by: username_0 on 2022-05-27)
  
  I'm scanning old club zines. Apart from a colleague of mine who has the habit of hübnering up nested annotations with a mix of {[()]} (if done correctly, this should be no problem for PGN standard, since {} defines a comment regardless of additional brackets) there is also easily a ( mistaken for { in OCR or the other way round, or I forget to change () (in the zine) to {} or vice versa.
  Here is a random example of a bug from today:
  [FEN ""]  
  1. d4 Nf6 2. g3 c5 3. c3 cxd4 4. cxd4 d5 5. Nc3 Bf5 {comment} 6. Qb3 Nc6 7. Nf3 {comment} 7...Na5 8. Qa4+ Bd7 9. Qd1 {comment) 9...e6 10. Bg2 Bd6 11. O-O O-O 12. Ne5 {comment} 12...Rc8 {comment) 13. Bg5 Nc4 {comment} 14. Bxf6 gxf6 15. Nxc4 Rxc4 16. e4
  
  As you observe, two closing ) should be }. (Spotted them both in the source code?)
  Here are some options I already tried:
  
  My usual PGN software is ChessPad, which said "Bxf6 illegal move". But the error happened far before that.
  Caissa Online PGN (my other favorite tool) gives total nonsense.
  Lichess doesn't accept it at all.
  I'm too lazy at the moment to write a Python parser.
  Brian (comment below) suggested "abusing" the CSE PGN tool. Guess what, indeed it barfs exactly where it should (at the first error), and would be a viable option if I can't find the bug. I'm still not happy with writing a "fake" question just to parse my PGN files.
  
  Thus I would like you to suggest good standalone PGN software which nails down the error(s) in buggy PGNs exactly where it happens, as the CSE parser seems to do. This includes illegal moves due to typos, which are also frequent. (Clearly, this is tricky: a naive approach in the given example might pair the first closing bracket with the one still open after Qd1, and thus find as "next" move 12...Rc8 and protest there.)
  
  **Tags:** software, pgn, recommendations
  
  > **Comments:**
  > **username_1**: The Chess.SE replayer is JavaScript: https://cdn.sstatic.net/Js/webpack-chunks/58.c50238aa2ecc974aec89.en.js - in theory you could unminify that and run the relevant parts on your own (and even adjust it).  
  > **username_2**: To add to what @username_1 said, the replayer is based on my project here: https://github.com/andrewphoy/chess-replayer  
  > **username_0**: @username_2: Ah, THX. I give it a look. If it manages to always pinpoint the first error (which is of the dimension P=NP :-), that would be perfect.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2022-06-01. Score: 1 | Accepted answer
  
  Have you tried Scid? I tested your pgn on Scid v. 4.7.0 (Database/Import File(s) of PGN games...) and these are the results:
  
  1. When importing the game it provides the following message:
  
  > Importing from test.pgn...
  >
  > Imported 1 game.
  >
  > PGN errors/warnings:
  >
  > (game 1/line 6) Invalid Result tag: ?
  >
  > (game 1/line 8) Error parsing the tag pair FEN ""
  >
  > (game 1/line 9) Failed to parse the move: Bxf6
  >
  > (game 1/line 10) End of game, ignored the part after the last error.
  
  2. And this is the parsed game:
     [![enter image description here](https://i.sstatic.net/Esbfw.png)](https://i.sstatic.net/Esbfw.png)
  
  Not perfect, but better than Caissa and LiChess. And if you have a bunch of games to import, it doesn't crash and tells you which ones are buggy.
  
  > **Comments:**
  > **username_0**: Batch will definitely come in handy (although ChessPad already can do that too). I ACKed the answer; even if username_2's solution is the best at the end...I just hate Java :-)  
  
  ---
  
  