Webpage to remove comments from your Pgn

Sort:
JEMP7YMETHOD

I've noticed really ugly clock information in the PGN that some people post, it looks something like this: [%clk 0:05:00]

And I guess it's the way v3 of the site formats the PGN?  Anyway, if you are not interested in the clock information and want to remove those comments, I've created a little webpage that will do it for you, here:

http://pgntools.nfshost.com/comment_remover.html

Below is a before and after screenshot -- if the image is too small you can right click on it and select "Open in New Tab".  You can also save the webpage to your computer, it's only "static" html and javascript, and run it on your computer instead of via the web page.

Hope this helps somebody

notmtwain

You can also just get your pgn on V2.

JEMP7YMETHOD

But it's also helpful if you want to remove comments from *any* pgn, not just those generated by chess.com's v3

EscherehcsE
uscftigerprowl wrote:
Doesn't work. <snip>

Maybe your PGN wasn't formatted well enough, or maybe the web page has a size limit.

 

Norm Pollock's trim utility should work. It's a command-line utility that's part of his 40H-PGN Utility Suite. However, before executing the trim utility, you will have to manually reformat the PGN slightly so that each tag is on a separate line and a blank line is between the last tag and the start of the move text.

http://www.hoflink.com/~npollock/40H.html

JEMP7YMETHOD
uscftigerprowl wrote:

"each tag is on a separate line and a blank line is between the last tag and the start of the move text"

 

It is like that, but when I copy and paste it bunches it all together.

I took your giant wall of pgn you pasted above, made sure each pgn header (which the comment remover shouldn't touch) was on it's own line, then ran it through my program, and it worked perfectly.  Below is the screenshot, and again, if it's too small to read, right click on it, and open the screenshot image in a new tab.

EscherehcsE
JEMP7YMETHOD wrote:
uscftigerprowl wrote:

"each tag is on a separate line and a blank line is between the last tag and the start of the move text"

 

It is like that, but when I copy and paste it bunches it all together.

I took your giant wall of pgn you pasted above, made sure each pgn header (which the comment remover shouldn't touch) was on it's own line, then ran it through my program, and it worked perfectly.  Below is the screenshot, and again, if it's too small to read, right click on it, and open the screenshot image in a new tab.

 

This is really strange...

I'm using Firefox and Noscript (of course, I've allowed pgntools.nfshost.com).

If I open your web page in a new tab, it doesn't work. However, if I open the web page in a new window, or if I save the page to my PC, it does work. Go figure...

JEMP7YMETHOD

So to be sure it wasn't a browser issue I just used IE (I'd previously been using Chrome) and the input of "The Game of the/last Century" you can here, with annotations/comments:

http://www.chessgames.com/perl/nph-chesspgn?text=1&gid=1008361

And below is the (expected) output I got.  At worst there are line breaks in funny places.

[Event "Third Rosenwald Trophy"]
[Site "New York, NY USA"]
[Date "1956.10.17"]
[EventDate "1956.10.07"]
[Round "8"]
[Result "0-1"]
[White "Donald Byrne"]
[Black "Robert James Fischer"]
[ECO "D92"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "82"]

1. Nf3 Nf6 2. c4 g6 3. Nc3 Bg7 4. d4 O-O 5. Bf4 d5 6. Qb3 dxc4
7. Qxc4 c6 8. e4 Nbd7 9. Rd1 Nb6 10. Qc5 Bg4 11. Bg5  Na4  12. Qa3  Nxc3 
13. bxc3 Nxe4 
14. Bxe7 Qb6 15. Bc4 Nxc3 16. Bc5 Rfe8+ 17. Kf1 Be6  18. Bxb6 Bxc4+
19. Kg1 Ne2+ 20. Kf1 Nxd4+  21. Kg1 Ne2+ 22. Kf1 Nc3+ 23. Kg1 axb6 24. Qb4
Ra4 25. Qxb6 Nxd1 26. h3 Rxa2 27. Kh2 Nxf2 28. Re1 Rxe1
29. Qd8+ Bf8 30. Nxe1 Bd5 31. Nf3 Ne4 32. Qb8 b5  33. h4 h5 34. Ne5 Kg7 35. Kg1 Bc5+ 36. Kf1
Ng3+  37. Ke1 Bb4+ 38. Kd1 Bb3+ 39. Kc1 Ne2+ 40. Kb1 Nc3+
41. Kc1 Rc2# 0-1

JEMP7YMETHOD
EscherehcsE wrote: 

This is really strange...

I'm using Firefox and Noscript (of course, I've allowed pgntools.nfshost.com).

If I open your web page in a new tab, it doesn't work. However, if I open the web page in a new window, or if I save the page to my PC, it does work. Go figure...

When running FF I have no problem opening http://pgntools.nfshost.com/comment_remover.html in a new tab, so there's some chance it has something to do with the "NoScript" plugin.

However because of the original, albeit seemingly incorrect, report of "Doesn't work", I decided I also needed to try it out in IE because I'd originally only done so in Chrome.  And it works in IE just fine

EscherehcsE

Just to recap:

 

The big advantage of using JEMP7YMETHOD's "PGN Comment Remover" web site is that it's more convenient - Just copy and paste the PGN contents to his web site. (Norm Pollock's "trim" utility is a command-line utility, which is less convenient.)

 

There are several possible advantages of using Norm Pollock's "trim" utility.

1) You're not dependent on internet access.

2) "trim" lets you set the maximum output width in the "MoveText Section" from 40 to 100 characters. The default is 76 characters.

3) "trim" changes any occurrences of numerical castling notation ("0-0", "0-0-0") to alphabetical ("O-O", "O-O-O").

4) "trim" will always start a new line of moves with a move number.

Antecurs

Try this

https://pgnchess.com/Chess/PGNUtil

EscherehcsE
AcceleratedDragonBreath wrote:

That page no longer loads. Does anyone know of another site that can do this?

The Wayback Machine to the rescue...

https://web.archive.org/web/20171012044143/http://pgntools.nfshost.com/comment_remover.html

Also, Norm Pollock's current web site:

https://40h.000webhostapp.com/

 

sholom90

Those utilties work to remove comments -- but what about removing variations?  Suppose I want only the moves that were played in the game?

EscherehcsE
sholom90 wrote:

Those utilties work to remove comments -- but what about removing variations?  Suppose I want only the moves that were played in the game?

The command-line program named "pgn-extract" ought to do the job:

https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/

https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html#suppress