PDA

View Full Version : Removing Clock Times from pgn Files



Patrick Byrom
10-01-2020, 12:02 AM
Thanks to Shaun Press for this trick (http://chessexpress.blogspot.com/):

My most recent problem was that the pgn files from the 2020 Australian Championship had the clock times included as comments. Normally this isn't a problem as you can strip comments using chessbase, but as I don't have that on my laptop, it required a different solution (that wasn't manual deletion). \{[\s\S]*?}\s was the magic incantation used in Brackets, which was sufficient to get the file into something I could use more easily. And as proof, here is a nice win by Jack Puccini from yesterdays round.

He used Brackets, but I'd suggest Notepad++ (https://notepad-plus-plus.org/downloads/v7.8.2/), which is just an upgraded version of the basic Windows text editor Notepad. In the string to be replaced, use \{[\s\S]*?}\s and leave the replacement string blank. Then this:

1. e4 {[%clk 01:30:53]} {[%emt 00:13:49]} d5 {[%clk 01:30:37]} 2. exd5 Qxd5
{[%clk 01:30:59]} 3. Nc3 {[%clk 01:31:26]} {[%emt 00:00:07]} Qd8 {[%clk
01:31:13]} {[%emt 00:00:15]} 4. d4 {[%clk 01:31:36]} {[%emt 00:00:22]} Nf6

will become this:

1. e4 d5 2. exd5 Qxd5
3. Nc3 Qd8 4. d4 Nf6

which (with a bit of tidying up) will look a lot better in the pgn viewer.

I believe that Chesspad and Tarrasch can also do something similar.

Adamski
10-01-2020, 11:20 AM
Thanks - a tip I may get to use.

Kevin Bonham
10-01-2020, 06:15 PM
Useful, thanks for posting.

Capablanca-Fan
11-01-2020, 01:33 AM
Very useful, thanks. Those posted times are annoying when posting games on this site.

Patrick Byrom
11-01-2020, 12:41 PM
Very useful, thanks. Those posted times are annoying when posting games on this site.They certainly are. Also annoying when trying to use games for coaching.