Looking for PGN sorting but in order of my choice

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Adam Hair
Posts: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Looking for PGN sorting but in order of my choice

Post by Adam Hair » Mon Jan 19, 2015 12:26 am

Adam Hair wrote:I think what Paul means is that he wants to order the games in his source pgn so that games 1, 6, 11, ... are eco code A, games 2, 7, 12, ... are eco B, ..., and games 5, 10, 15, .... are eco code E.

I think I have the means of doing this using pgn extract, some of Norm Pollock's tools, Unix commands, and an unreleased version of Gaviota that can match a position in an epd file to a game containing that position. It would be a convoluted process, but it might work okay.
I failed. I have an epd of the final positions sorted in the manner Paul desires. And I have a method for converting the epd into a pgn using Paul's source pgn. Unfortunately, I have no way of converting the epd into a pgn that preserves the order of the epd. Hopefully Norm can get work this out.

PaulieD
Posts: 205
Joined: Tue Jun 25, 2013 6:19 pm

Re: Looking for PGN sorting but in order of my choice

Post by PaulieD » Mon Jan 19, 2015 12:37 am

Adam,

Thanks so much for your efforts! I appreciate the work you have put into this.

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

Re: Looking for PGN sorting but in order of my choice

Post by Adam Hair » Mon Jan 19, 2015 12:55 am

You are welcome Paul. I wish I could have completed the job.


User avatar
reflectionofpower
Posts: 1456
Joined: Fri Mar 01, 2013 4:28 pm
Location: USA

Re: Looking for PGN sorting but in order of my choice

Post by reflectionofpower » Mon Jan 19, 2015 2:28 am

Chess Assistant 13 does it easily
"hodie mihi, cras tibi"

Lonnie

User avatar
Graham Banks
Posts: 33020
Joined: Sun Feb 26, 2006 9:52 am
Location: Auckland, NZ

Re: Looking for PGN sorting but in order of my choice

Post by Graham Banks » Mon Jan 19, 2015 2:44 am

Hi Norm,

I'm interested in this pgn, but I can't extract it from the zip file.

Regards,
Graham.
My email addresses:
gbanksnz at gmail.com
gbanksnz at yahoo.co.nz

Norm Pollock
Posts: 1017
Joined: Thu Mar 09, 2006 3:15 pm
Location: Long Island, NY, USA
Contact:

Re: Looking for PGN sorting but in order of my choice

Post by Norm Pollock » Mon Jan 19, 2015 2:48 am

Graham Banks wrote:
Hi Norm,

I'm interested in this pgn, but I can't extract it from the zip file.

Regards,
Graham.
I used 7-zip with no problem.

User avatar
Graham Banks
Posts: 33020
Joined: Sun Feb 26, 2006 9:52 am
Location: Auckland, NZ

Re: Looking for PGN sorting but in order of my choice

Post by Graham Banks » Mon Jan 19, 2015 3:13 am

Norm Pollock wrote:
Graham Banks wrote:
Hi Norm,

I'm interested in this pgn, but I can't extract it from the zip file.

Regards,
Graham.
I used 7-zip with no problem.
Okay. It worked this time. Sorry to bother you.
My email addresses:
gbanksnz at gmail.com
gbanksnz at yahoo.co.nz

PaulieD
Posts: 205
Joined: Tue Jun 25, 2013 6:19 pm

Re: Looking for PGN sorting but in order of my choice

Post by PaulieD » Mon Jan 19, 2015 3:13 am

Norm,

I cannot thank you enough, THIS will be a great opening suite now.
You worked hard and I really appreciate all your efforts.

Everyone enjoy!!

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

Re: Looking for PGN sorting but in order of my choice

Post by Ferdy » Mon Jan 19, 2015 3:50 am

PaulieD wrote:What happened is it put them in all A00 then all A01 and so on
I should have been more specific possibly.
Game 1 any A Eco code
Game 2 any B Eco code
Game 3 any C Eco code

It was quick I hope that file can be modified to accomplish my request.
Many Thanks.

Edit:
I tried the E1 switch and all it did was jumble all the A's to the top of the pgn.
I thought I also need this tool to my test sets, so I have done a python script together with pgn-extract to do this. Install python and rename your original pgn file to src.pgn. The script also uses system cmd and tested to work in windows 7. Note there is a sample src.pgn in the download file as a sample. Also pgn-extract-17-14 is already included.

Sample run. I use your uploaded pgn file.

Code: Select all

found src.pgn !!
Deleting existing a.pgn ... e.pgn files ...
pgn-extract-17-14 running to get a.pgn ... e.pgn ...
Count games in a.pgn ... e.pgn to get max games ...
a numgames 1458
b numgames 1100
c numgames 622
d numgames 1088
e numgames 732
max value 1458
total games 5000
Writing games please wait this may take time ...
Fixing spaces between games in output pgn file ...
Deleting unwanted files ...
time: 52.2 sec
done!! look at out.pgn

press any key to exit
Download:
http://www.mediafire.com/download/tk996 ... _games.rar

Post Reply