I have written a program "epdPosition" that together in a batch file with "PGN Extract 17-21" and one of my other programs "numExtract", should meet the specs mentioned by Dann Corbit in the first post.
download (containing epdPosition.exe, numExtract.exe and pgnPosition.bat):
http://www.mediafire.com/download/5g5tg ... osition.7z
The batch file is pgnPosition.bat
It uses a user-made text file ("positions") of epd positions, 1 per line
Usage:
pgnPosition positions alpha.pgn
(make sure all 3 programs are accessible)
Output:
manifest-ps (listing of each match: game #, ply #)
outZ.pgn (extracted games that contain the match)
excludeZ.pgn (extracted games NOT containing a match)
Contents of pgnPosition.bat
pgn-extract -Wepd --nofauxep -s -otemp.epd %2
epdPosition %1 temp.epd
numExtract numbers %2
Note: a game can contain more that one match
Looking for a PGN/EPD utility
Moderators: hgm, Rebel, chrisw
-
- Posts: 1056
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Looking for a PGN/EPD utility
Fabulous.
Thank you for this.
It will save me a lot of time.
Thank you for this.
It will save me a lot of time.
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Looking for a PGN/EPD utility
It appears that this process allows only 100 lines from the EPD file:
F:\chess\position>pgn-extract -Wepd --nofauxep -s -otemp.epd iccfb.pgn
Games: 9010
F:\chess\position>epdPosition positions temp.epd
Array Index Out of Bounds error!
line number 101
FEN "rn3rk1/ppq2pp1/2pbpn1p/8/N1PP1Bb1/5NP1/PP3PBP/R2QR1K1 w - - 0 1"
F:\chess\position>numextract numbers iccfb.pgn
Number of games in iccfb.pgn is 9016
Number of games in outZ.pgn is 0
finished: be sure to rename/copy outZ.pgn and excludeZ.pgn
I have 2078 in this particular file, and I am likely to have tens of thousands in other files. Is it possible to get the array size configurable or allocated to a large size such as 100,000?
F:\chess\position>pgn-extract -Wepd --nofauxep -s -otemp.epd iccfb.pgn
Games: 9010
F:\chess\position>epdPosition positions temp.epd
Array Index Out of Bounds error!
line number 101
FEN "rn3rk1/ppq2pp1/2pbpn1p/8/N1PP1Bb1/5NP1/PP3PBP/R2QR1K1 w - - 0 1"
F:\chess\position>numextract numbers iccfb.pgn
Number of games in iccfb.pgn is 9016
Number of games in outZ.pgn is 0
finished: be sure to rename/copy outZ.pgn and excludeZ.pgn
I have 2078 in this particular file, and I am likely to have tens of thousands in other files. Is it possible to get the array size configurable or allocated to a large size such as 100,000?
-
- Posts: 1056
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
Re: Looking for a PGN/EPD utility
http://www.mediafire.com/download/7xkuc ... sition.exe
I set "size" to 100000 from 100
100000 is going to take awhile to process.
I suggest putting a number comment in each game of the pgn file if you have not already done so. One such program that does this is "gameNum". It is in the 40H-PGN suite on my home page (www below).
I set "size" to 100000 from 100
100000 is going to take awhile to process.
I suggest putting a number comment in each game of the pgn file if you have not already done so. One such program that does this is "gameNum". It is in the 40H-PGN suite on my home page (www below).
-
- Posts: 1535
- Joined: Sun Oct 25, 2009 2:30 am
Re: Looking for a PGN/EPD utility
Does "epdFin" have any such limitation? I'm going to need, to run millions of positions, trough it.Norm Pollock wrote:http://www.mediafire.com/download/7xkuc ... sition.exe
I set "size" to 100000 from 100
100000 is going to take awhile to process.
I suggest putting a number comment in each game of the pgn file if you have not already done so. One such program that does this is "gameNum". It is in the 40H-PGN suite on my home page (www below).
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Looking for a PGN/EPD utility
Are the elements of file positions supposed to be of this format:
FEN "1rb2rk1/1p1nqpbp/p2p1np1/2pP4/P4B2/2N1PN1P/1P2BPP1/R2Q1RK1 w - - 0 1"
or something else?
I get wrong filtering.
Edit:
I figured it out.
You wanted:
rr4k1/3nppbp/b2p1np1/q1pP4/8/2N2NP1/PPQ1PPBP/1RB2RK1 w - - 0 1
FEN "1rb2rk1/1p1nqpbp/p2p1np1/2pP4/P4B2/2N1PN1P/1P2BPP1/R2Q1RK1 w - - 0 1"
or something else?
I get wrong filtering.
Edit:
I figured it out.
You wanted:
rr4k1/3nppbp/b2p1np1/q1pP4/8/2N2NP1/PPQ1PPBP/1RB2RK1 w - - 0 1
-
- Posts: 1056
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
Re: Looking for a PGN/EPD utility
No. You should be fine. but there is a limit that no single game in the original "pgn" file can have more than 2000 lines (positions). If you exceed that, then there will be a crash. 2000 lines = 999.5 moves. Let me know if you hit that limit.Ozymandias wrote:Does "epdFin" have any such limitation? I'm going to need, to run millions of positions, trough it.Norm Pollock wrote:http://www.mediafire.com/download/7xkuc ... sition.exe
I set "size" to 100000 from 100
100000 is going to take awhile to process.
I suggest putting a number comment in each game of the pgn file if you have not already done so. One such program that does this is "gameNum". It is in the 40H-PGN suite on my home page (www below).
I am reviewing all my programs to find those that use a user-specified file that gets read into an array. Those files are limited by the size of the array. Most likely I will enlarge the array size.
-
- Posts: 1056
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
Re: Looking for a PGN/EPD utility
The "epd" record can have a comment, or be a "FEN". It's only the first 4 fields that are matched. Examples:Dann Corbit wrote:Are the elements of file positions supposed to be of this format:
FEN "1rb2rk1/1p1nqpbp/p2p1np1/2pP4/P4B2/2N1PN1P/1P2BPP1/R2Q1RK1 w - - 0 1"
or something else?
I get wrong filtering.
Edit:
I figured it out.
You wanted:
rr4k1/3nppbp/b2p1np1/q1pP4/8/2N2NP1/PPQ1PPBP/1RB2RK1 w - - 0 1
rr4k1/3nppbp/b2p1np1/q1pP4/8/2N2NP1/PPQ1PPBP/1RB2RK1 w - - 0 1
rr4k1/3nppbp/b2p1np1/q1pP4/8/2N2NP1/PPQ1PPBP/1RB2RK1 w - - c0 comment;
-
- Posts: 1535
- Joined: Sun Oct 25, 2009 2:30 am
Re: Looking for a PGN/EPD utility
I truncate games at ply 600, so I don't anticipate any problems.Norm Pollock wrote:there is a limit that no single game in the original "pgn" file can have more than 2000 lines (positions). If you exceed that, then there will be a crash. 2000 lines = 999.5 moves. Let me know if you hit that limit.
-
- Posts: 1535
- Joined: Sun Oct 25, 2009 2:30 am
Re: Looking for a PGN/EPD utility
I finally tried epdPostion and I still get the same message (Array Index Out of Bounds error!), only at 100001 lines, of course. The search.epd file is 730 MB, and the temp.epdn is 1.11 GB.Norm Pollock wrote:http://www.mediafire.com/download/7xkuc ... sition.exe
I set "size" to 100000 from 100
100000 is going to take awhile to process.
I suggest putting a number comment in each game of the pgn file if you have not already done so. One such program that does this is "gameNum". It is in the 40H-PGN suite on my home page (www below).
Can we amp up the steroids again (3 more zeros)?