Looking for PGN sorting but in order of my choice

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

Moderators: hgm, Rebel, chrisw

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

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

Post by Adam Hair »

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: 211
Joined: Tue Jun 25, 2013 8:19 pm

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

Post by PaulieD »

Adam,

Thanks so much for your efforts! I appreciate the work you have put into this.
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

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

Post by Adam Hair »

You are welcome Paul. I wish I could have completed the job.
Norm Pollock
Posts: 1056
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

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

Post by Norm Pollock »

User avatar
reflectionofpower
Posts: 1607
Joined: Fri Mar 01, 2013 5:28 pm
Location: USA

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

Post by reflectionofpower »

Chess Assistant 13 does it easily
"Without change, something sleeps inside us, and seldom awakens. The sleeper must awaken." (Dune - 1984)

Lonnie
User avatar
Graham Banks
Posts: 41415
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

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

Post by Graham Banks »

Hi Norm,

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

Regards,
Graham.
gbanksnz at gmail.com
Norm Pollock
Posts: 1056
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

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

Post by Norm Pollock »

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: 41415
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

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

Post by Graham Banks »

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.
gbanksnz at gmail.com
PaulieD
Posts: 211
Joined: Tue Jun 25, 2013 8:19 pm

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

Post by PaulieD »

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: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

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

Post by Ferdy »

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