PGN Extract

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
LucenaTheLucid
Posts: 197
Joined: Mon Jul 13, 2009 12:16 am

PGN Extract

Post by LucenaTheLucid » Mon Sep 19, 2011 1:46 am

Has anyone ever coded an interface for PGN extract? I think this would be an extremely useful tool. I understand that a lot of you do not mind using a command line but it is extremely painful for me. I understand that this would be a non-trivial task but never the less it would save me lots of time in cleaning PGN files.

I would code such a thing myself but alas I do not know how to program.

Or does anyone know of a database with all of the functions that PGN extract supports? I have the newest version of scid but it still seems very limited on what it can do.

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: PGN Extract

Post by Jim Ablett » Mon Sep 19, 2011 4:39 am

LucenaTheLucid wrote:Has anyone ever coded an interface for PGN extract? I think this would be an extremely useful tool. I understand that a lot of you do not mind using a command line but it is extremely painful for me. I understand that this would be a non-trivial task but never the less it would save me lots of time in cleaning PGN files.

I would code such a thing myself but alas I do not know how to program.

Or does anyone know of a database with all of the functions that PGN extract supports? I have the newest version of scid but it still seems very limited on what it can do.
Hi Luis,

I wrote little batch file based tool a while back which uses PgnExtract (among other utilitities such as Norm Pollocks pgn tools)
to automatically clean pgns. Not a gui I know, but might be useful to you.

http://www.mediafire.com/?9wsibbbe66q84y1

Jim.

Ferdy
Posts: 4591
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: PGN Extract

Post by Ferdy » Sun Sep 25, 2011 5:01 pm

LucenaTheLucid wrote:Has anyone ever coded an interface for PGN extract? I think this would be an extremely useful tool. I understand that a lot of you do not mind using a command line but it is extremely painful for me. I understand that this would be a non-trivial task but never the less it would save me lots of time in cleaning PGN files.

I would code such a thing myself but alas I do not know how to program.

Or does anyone know of a database with all of the functions that PGN extract supports? I have the newest version of scid but it still seems very limited on what it can do.
I started building one, what options do you use most or would like to be added aside from cleaning the files? I can't implement all :) not this time. It is a typical window form using ms visual c#.
What I have implemented so far are:
* no comments
* no variations
* no NAGs
* no tags
* no move numbers
* no results
* remove duplicates
* add ECO (requires eco.pgn)
* ply limit
* line length

LucenaTheLucid
Posts: 197
Joined: Mon Jul 13, 2009 12:16 am

Re: PGN Extract

Post by LucenaTheLucid » Mon Sep 26, 2011 12:08 am

Your generosity is plenty. I think that is probably more features than I wanted. Not that I am complaining you see. ^_^

I spent 3 hours fumbling with PGN Extract. Guess I am just not smart enough to do it. Also thought it would be a great idea if you could just specify a file directory and tick which options you wanted and pushed the "clean" button or something like that. It actually surprises me no one has done it yet.

Also Jim your tool is mighty useful. I can only get it to go 1 run though. Any 2nd PGN file I want to run through it just outputs a blank file.

Ferdy
Posts: 4591
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: PGN Extract

Post by Ferdy » Thu Oct 20, 2011 1:00 pm

Pgn-extract Interface is now released can be found here.
https://sites.google.com/site/deuterium ... ownloads-1

Not all options are implemented though. Options implemented are:
* no comments
* no variations
* no NAGs
* no tags
* no move numbers
* no results
* remove duplicates
* add ECO (requires eco.pgn)
* ply limit
* line length
* search games by elo rating
* search games by players
* search games by year
* search games by ECO
* search games by number of moves in a game
* search games by result, 1-0, 0-1 and others
* able to separate games of a player out from the given pgn file
* able to separate games by criteria out from a given pgn file
* output games into files based on the number of games in a file
* output games into files based on ECO codes
* change move formats such as long algebraic and others
* added a tool to combined pgn files

Sample search combination can be done easily, like
search games played by Crafty as white where the result is 1-0 with opponent having a rating of 2800 and above in the year 2008-2010, limited to number of moves not more than 40, clean the output file and remove duplicates.

Be reminded to read the readme file. Also pgn-extract is not included in the package, you have to download it yourself.

Thanks to the excellent pgn-extract program file.
Thanks to Luis for giving me the drive to create this.

User avatar
Giorgio Medeot
Posts: 52
Joined: Fri Jan 29, 2010 1:01 pm
Location: Ivrea, Italy

Re: PGN Extract

Post by Giorgio Medeot » Thu Oct 20, 2011 1:28 pm

Ferdy wrote:Thanks to the excellent pgn-extract program file.
Thanks to Luis for giving me the drive to create this.
And thanks to you for providing this neat interface!

Cheers,
  • Giorgio

LucenaTheLucid
Posts: 197
Joined: Mon Jul 13, 2009 12:16 am

Re: PGN Extract

Post by LucenaTheLucid » Thu Oct 20, 2011 2:28 pm

Thank you Ferdinand. This tool has been a great help.

Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: PGN Extract

Post by Adam Hair » Thu Oct 20, 2011 8:36 pm

And I will again thank you for the interface.. :)

JManion
Posts: 195
Joined: Wed Dec 23, 2009 7:53 am

Re: PGN Extract

Post by JManion » Sat Oct 22, 2011 4:46 am

2 questions

1. When I downloaded the interface and the pgn extract, I put them in the same folder. I then clicked on the pgn-interface and got the following error

unable to find a version of runtime to run this app.

2. I tried to follow the directions without the interface. I putt he pgn file in the folder. I doubled clicked on the process file. In 1 second it was done and the pgn disappeared. I checked the folders and I had all blank files.

The pgn is roughly 2 GB with plenty of games.

thanks for the help

LucenaTheLucid
Posts: 197
Joined: Mon Jul 13, 2009 12:16 am

Re: PGN Extract

Post by LucenaTheLucid » Sat Oct 22, 2011 5:35 am

Even though they are in the same directory you still have to point to where PGN Extract is at in the interface. You can do this by hitting the PGN-Extract button at the top.

Post Reply