A new utility to extract games from PGN files by text

Archive of the old Parsimony forum. Some messages couldn't be restored. Limitations: Search for authors does not work, Parsimony specific formats do not work, threaded view does not work properly. Posting is disabled.

A new utility to extract games from PGN files by text

Postby Igor Gorelikov » 12 Apr 2004, 13:11

Geschrieben von:/Posted by: Igor Gorelikov at 12 April 2004 14:11:36:


My new utility to extract games from PGN files by text ("PGN-xt" that is
PGN Extract by Text) is available for downloads from here (2K):
http://www.digichess.gr/infiniteloop/tools/PGN-xt1.zip
A bit of readme file:
=====================
Pgn-xt is a utility to search a PGN file for the text specified and extract
the games found to the output PGN file.
You may search for any text within games: tags, comments, moves, etc.
Examples of search text:

#1.on time it extracts all the games lost on time
#1."0 1800 +3 0 0" it extracts all the games with the given time
control
#1.White "Ruffian 1.0.1 it extracts all the games of Ruffian 1.0.1 as
white
#1.Ruffian 1.0.1 it extracts all the games of Ruffian 1.0.1
#1.Ruffian it extracts all the games of all Ruffian versions
#1."Anand it extracts all the games of Anand
#1.Anand it extracts all the games of Anand, as
well as the games with comments containing
word "Anand"
#1.[Black "Chinito 3.1"] it extracts all the games of Chinito 3.1 as Black

The program is a DOS/Windows batch file that uses famous SED & AWK to do
the job.
So to run it you need download and put them into the Windows folder (or in
the folder with Pgn-xt.bat).
AWK for Windows (140K) can be downloaded from here:
http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe
SED for Windows (40K) can be downloaded from here:
http://sed.sourceforge.net/grabbag/ssed/sed-3.59.zip
Please rename "sed-3.59.exe" into "sed.exe" after downloads, as well as
"awk95.exe" into "awk.exe". Note that the batch file uses names "sed" and
"awk".
==================================================
Those and further details you can find in readme.txt
Igor Gorelikov
Igor Gorelikov
 

Re: A new utility to extract games from PGN files by text

Postby Norm Pollock » 12 Apr 2004, 14:29

Geschrieben von:/Posted by: Norm Pollock at 12 April 2004 15:29:50:
Als Antwort auf:/In reply to: A new utility to extract games from PGN files by text geschrieben von:/posted by: Igor Gorelikov at 12 April 2004 14:11:36:

I'm having trouble getting pgn-xt.bat to operate properly. Here is my pgn-xt.ini and my output. All files are in the same folder, including renamed awk.exe and sed.exe, and a pgn file.
pgn-xt.ini file:
#1.Tal
#2.CG.pgn
#3.Tal.pgn
output:
F:\PGN-EX~1>sed "/#1./s/[\_\.\,\:\;\{\}\"\'\/\\]/\\ & /g;/#1./s/\[/\\ & /g;/#1./s/\]/\\ & /g" pgn-xt.ini > tagx0.tmp
F:\PGN-EX~1>copy tagx0.tmp+pgn-xt.dat tagx1.tmp
The system cannot find the file specified.
F:\PGN-EX~1>sed "/#1/h;/label1/g" tagx1.tmp 1>tagx2.tmp
F:\PGN-EX~1>sed -n "2,$p" tagx2.tmp 1>tagx3.tmp
F:\PGN-EX~1>sed "/#1/N;s/\n//g" tagx3.tmp 1>tagx4.tmp
F:\PGN-EX~1>sed "/sed \-n/N;s/\n//g;s/#1\\\.//" tagx4.tmp 1>tagx5.tmp
F:\PGN-EX~1>sed "/#2/h;/label2/g" tagx5.tmp 1>tagx6.tmp
F:\PGN-EX~1>sed -n "2,$p" tagx6.tmp 1>tagx7.tmp
Norm Pollock
 

Re: A new utility to extract games from PGN files by text

Postby Igor Gorelikov » 12 Apr 2004, 14:47

Geschrieben von:/Posted by: Igor Gorelikov at 12 April 2004 15:47:01:
Als Antwort auf:/In reply to: Re: A new utility to extract games from PGN files by text geschrieben von:/posted by: Norm Pollock at 12 April 2004 15:29:50:
I'm having trouble getting pgn-xt.bat to operate properly. Here is my pgn-xt.ini and my output. All files are in the same folder, including renamed awk.exe and sed.exe, and a pgn file.
pgn-xt.ini file:
#1.Tal
#2.CG.pgn
#3.Tal.pgn
output:
F:\PGN-EX~1>sed "/#1./s/[\_\.\,\:\;\{\}\"\'\/\\]/\\ & /g;/#1./s/\[/\\ & /g;/#1./s/\]/\\ & /g" pgn-xt.ini > tagx0.tmp
F:\PGN-EX~1>copy tagx0.tmp+pgn-xt.dat tagx1.tmp
The system cannot find the file specified.
Apparently it cannot find "pgn-xt.dat"
Where is it?
Igor
Igor Gorelikov
 

Re: A new utility to extract games from PGN files by text

Postby Norm Pollock » 12 Apr 2004, 15:27

Geschrieben von:/Posted by: Norm Pollock at 12 April 2004 16:27:25:
Als Antwort auf:/In reply to: Re: A new utility to extract games from PGN files by text geschrieben von:/posted by: Igor Gorelikov at 12 April 2004 15:47:01:
I'm having trouble getting pgn-xt.bat to operate properly. Here is my pgn-xt.ini and my output. All files are in the same folder, including renamed awk.exe and sed.exe, and a pgn file.
pgn-xt.ini file:
#1.Tal
#2.CG.pgn
#3.Tal.pgn
output:
F:\PGN-EX~1>sed "/#1./s/[\_\.\,\:\;\{\}\"\'\/\\]/\\ & /g;/#1./s/\[/\\ & /g;/#1./s/\]/\\ & /g" pgn-xt.ini > tagx0.tmp
F:\PGN-EX~1>copy tagx0.tmp+pgn-xt.dat tagx1.tmp
The system cannot find the file specified.
Apparently it cannot find "pgn-xt.dat"
Where is it?
Igor
Igor-
The pgn-xt.dat file is there. And there are no leftover tmp files.
I didn't give the error full output. The error that is occurring in the first line with "sed" does not output to a dos file. So I'll transcribe it by hand.
sed: -e expression #1, char 33: unterminated 's' command
'/g' is not recognized as an internal or external command, operable program or batch file.
'/g' is not recognized as an internal or external command, operable program or batch file.
'/g' is not recognized as an internal or external command, operable program or batch file.
-Norm
Norm Pollock
 

Re: A new utility to extract games from PGN files by text

Postby Igor Gorelikov » 12 Apr 2004, 15:35

Geschrieben von:/Posted by: Igor Gorelikov at 12 April 2004 16:35:46:
Als Antwort auf:/In reply to: Re: A new utility to extract games from PGN files by text geschrieben von:/posted by: Norm Pollock at 12 April 2004 16:27:25:

What is your OS?
Igor
Igor Gorelikov
 

Re: A new utility to extract games from PGN files by text

Postby Norm Pollock » 12 Apr 2004, 15:42

Geschrieben von:/Posted by: Norm Pollock at 12 April 2004 16:42:08:
Als Antwort auf:/In reply to: Re: A new utility to extract games from PGN files by text geschrieben von:/posted by: Igor Gorelikov at 12 April 2004 16:35:46:
What is your OS?
Igor
OS Name Microsoft Windows XP Home Edition
Version 5.1.2600 Service Pack 1 Build 2600
- Norm
Norm Pollock
 

Re: A new utility to extract games from PGN files by text

Postby Igor Gorelikov » 12 Apr 2004, 16:04

Geschrieben von:/Posted by: Igor Gorelikov at 12 April 2004 17:04:04:
Als Antwort auf:/In reply to: Re: A new utility to extract games from PGN files by text geschrieben von:/posted by: Norm Pollock at 12 April 2004 16:42:08:


What version of SED you use? (type "sed -V" at command line)
Please, send me your pgn-xt.ini by email (igor@vast.spb.ru).
BTW, I have tried my program only under Win98.
Igor
Igor Gorelikov
 

Re: A new utility to extract games from PGN files by text

Postby Norm Pollock » 12 Apr 2004, 16:22

Geschrieben von:/Posted by: Norm Pollock at 12 April 2004 17:22:32:
Als Antwort auf:/In reply to: Re: A new utility to extract games from PGN files by text geschrieben von:/posted by: Igor Gorelikov at 12 April 2004 17:04:04:
What version of SED you use? (type "sed -V" at command line)
Please, send me your pgn-xt.ini by email (igor@vast.spb.ru).
BTW, I have tried my program only under Win98.
Igor
super-sed version 3.59
based on GNU sed version 3.02.80
Copyright (C) 1999 Free Software Foundation, Inc.

1999 written software could be the problem with xp
e-mail sent
Norm Pollock
 

Re: A new utility to extract games from PGN files by text

Postby Igor Gorelikov » 12 Apr 2004, 17:29

Geschrieben von:/Posted by: Igor Gorelikov at 12 April 2004 18:29:01:
Als Antwort auf:/In reply to: Re: A new utility to extract games from PGN files by text geschrieben von:/posted by: Norm Pollock at 12 April 2004 17:22:32:
What version of SED you use? (type "sed -V" at command line)
Please, send me your pgn-xt.ini by email (igor@vast.spb.ru).
BTW, I have tried my program only under Win98.
Igor
super-sed version 3.59
based on GNU sed version 3.02.80
Copyright (C) 1999 Free Software Foundation, Inc.

1999 written software could be the problem with xp
e-mail sent
Yes, you are right, finally I tried it under Windows XP and it is failed.
So my program also cannot run under Windows XP ;-(
I will try to solve the problem in the next release if possible.
Thanks for feedback.
Igor
Igor Gorelikov
 


Return to Archive (Old Parsimony Forum)

Who is online

Users browsing this forum: No registered users and 27 guests