Convert to PGN

G

Guest

Guest
Archived from groups: rec.games.chess.computer (More info?)

Is there any program that convets a game listing like the bellow to
PGN? (as a side question, does this format have a name?)

Doro,F - Minekawa,R
13o. Torneio Relampago Xadrez no Parque Sao Paulo (9), 22.09.2002

1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 e6 5.e3 Bb4 6.a3 Ba5 7.b4 Bc7 8.Bd3
dxc4 9.Bxc4 b5 10.Bd3 0-0 11.e4 a5 12.e5 Nfd7 13.Bxh7+ Kxh7 14.Ng5+ Kg8
15.Qh5 1-0

I saw http://pgn.freeservers.com/, but I'm not sure what can help me on
this conversion...

Thanks.
 
G

Guest

Guest
Archived from groups: rec.games.chess.computer (More info?)

WRobinson <cesarakg@gmail.com> wrote:
> Is there any program that convets a game listing like the bellow to
> PGN? (as a side question, does this format have a name?)
>
> Doro,F - Minekawa,R
> 13o. Torneio Relampago Xadrez no Parque Sao Paulo (9), 22.09.2002
>
> 1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 e6 5.e3 Bb4 6.a3 Ba5 7.b4 Bc7 8.Bd3
> dxc4 9.Bxc4 b5 10.Bd3 0-0 11.e4 a5 12.e5 Nfd7 13.Bxh7+ Kxh7 14.Ng5+ Kg8
> 15.Qh5 1-0

You just need to rewrite the header as a series of PGN tags. I'm not sure
you can do that automatically, though -- it would seem to involve a
certain amount of natural language processing. If you don't have a lot of
these, I'd suggest doing it by hand.


Dave.

--
David Richerby Disgusting Metal Boss (TM): it's like
www.chiark.greenend.org.uk/~davidr/ a middle manager that's made of steel
but it'll turn your stomach!
 

ceebee

Distinguished
Apr 5, 2004
197
0
18,680
Archived from groups: rec.games.chess.computer (More info?)

"WRobinson" <cesarakg@gmail.com> wrote in
rec.games.chess.computer:

> Doro,F - Minekawa,R
> 13o. Torneio Relampago Xadrez no Parque Sao Paulo (9),
> 22.09.2002
>
> 1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 e6 5.e3 Bb4 6.a3 Ba5 7.b4 Bc7
> 8.Bd3 dxc4 9.Bxc4 b5 10.Bd3 0-0 11.e4 a5 12.e5 Nfd7 13.Bxh7+
> Kxh7 14.Ng5+ Kg8 15.Qh5 1-0

This is simple ChessBase txt output. It uses non-standard headers,
and a program able to convert it to PGN should be able to
distinguish between header info (including result) and move info,
and there's no program around able to do it. Best do it manually.

--
CeeBee

"Eppur si muove!"
 
G

Guest

Guest
Archived from groups: rec.games.chess.computer (More info?)

WRobinson wrote:
| Is there any program that convets a game listing like the bellow to
| PGN? (as a side question, does this format have a name?)
|
| Doro,F - Minekawa,R
| 13o. Torneio Relampago Xadrez no Parque Sao Paulo (9), 22.09.2002
|
| 1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 e6 5.e3 Bb4 6.a3 Ba5 7.b4 Bc7 8.Bd3
| dxc4 9.Bxc4 b5 10.Bd3 0-0 11.e4 a5 12.e5 Nfd7 13.Bxh7+ Kxh7 14.Ng5+
| Kg8
| 15.Qh5 1-0
|
| I saw http://pgn.freeservers.com/, but I'm not sure what can help me
| on this conversion...

It's been a couple of years since I've used it, but IIRC ChessU4 can
convert these headers to PGN. This format was quite popular before PGN
was around (can't remember what it was called tho).

Daniel
 
G

Guest

Guest
Archived from groups: rec.games.chess.computer (More info?)

Daniel South wrote:
| WRobinson wrote:
|| Is there any program that convets a game listing like the bellow to
|| PGN? (as a side question, does this format have a name?)
||
|| Doro,F - Minekawa,R
|| 13o. Torneio Relampago Xadrez no Parque Sao Paulo (9), 22.09.2002
||
|| I saw http://pgn.freeservers.com/, but I'm not sure what can help me
|| on this conversion...
|
| It's been a couple of years since I've used it, but IIRC ChessU4 can
| convert these headers to PGN. This format was quite popular before PGN
| was around (can't remember what it was called tho).

Correction. Program is Normal32 which is included with PGNSort. Format
is NTR.

Daniel
 
G

Guest

Guest
Archived from groups: rec.games.chess.computer (More info?)

On Fri, 08 Apr 2005 at 19:07 GMT, WRobinson wrote:
> Is there any program that convets a game listing like the bellow to
> PGN? (as a side question, does this format have a name?)
>
> Doro,F - Minekawa,R
> 13o. Torneio Relampago Xadrez no Parque Sao Paulo (9), 22.09.2002
>
> 1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 e6 5.e3 Bb4 6.a3 Ba5 7.b4 Bc7 8.Bd3
> dxc4 9.Bxc4 b5 10.Bd3 0-0 11.e4 a5 12.e5 Nfd7 13.Bxh7+ Kxh7 14.Ng5+ Kg8
> 15.Qh5 1-0
>
> I saw http://pgn.freeservers.com/, but I'm not sure what can help me on
> this conversion...

This script will run in a Unix (POSIX) shell. I am assuming that
(9) is the round; there is no separating the Event from the Site.
The script reads only one game per file, but multiple files can be
given on the command line.

## NAME: ntr2pgn
## USAGE: ntr2pgn FILE ...
for file
do
(
read white x black
read line
game=`cat`

date=${line##* }
event=${line%, *}

## Reformat date
year=${date##*.}
day=${date%%.*}
month=${date%.$year}
month=${month#*.}
date=$year.$month.$day

## Extract round number
oldIFS=$IFS
IFS='()'
set -- ${event}
eval round=\$$#
IFS=$oldIFS

## Extract result from game
set -- $game
eval result=\${$#}

## Print header
printf "[Event \"%s\"]\n" "${event% ("$round")}"
printf "[Site \"%s\"]\n" "${site:-*}"
printf "[Date \"%s\"]\n" "${date:-*}"
printf "[Round \"%s\"]\n" "${round:-*}"
printf "[White \"%s\"]\n" "${white:-*}"
printf "[Black \"%s\"]\n" "${black:-*}"
printf "[Result \"%s\"]\n" "${result:-*}"

printf "%s\n\n" "$game"
) < "$file"
done


--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
 
G

Guest

Guest
Archived from groups: rec.games.chess.computer (More info?)

I like it.

I had some friend written some AWK code to do the same, you can see it
here (I added the Copyright note, and I'm assuming it has no
restriction to distribution and use):

#!/usr/bin/env awk
#(C) Mikhail Rickoi 2005

{
if (i= index($0, r= "0-1")) {
g= substr($0,0,i-2)
h= substr($0,i+4)
} else if (i= index($0, r= "1-0")) {
g= substr($0,0,i-2)
h= substr($0,i+4)
}
w= substr(h, 1, (i= index(h,"-")) -1) ; h= substr(h, i+1)
b= substr(h, 1, (i= index(h,", ")) -1) ; h= substr(h, i+2)
s= substr(h, 1, (i= index(h," ")) -1) ; h= substr(h, i+1)
d= h

printf "[Event \"%s %s\"]\n", s, d
printf "[Site \"%s\"]\n" , e
printf "[Date \"%s\"]\n" , d
printf "[Round \"%s\"]\n" , ""
printf "[White \"%s\"]\n" , w
printf "[Black \"%s\"]\n" , b
printf "[Result \"%s\"]\n", r
printf "\n%s %s\n\n", g, r
}
##EOF

I used it to convert the page at
http://www.geocities.com/siliconvalley/lab/7378/traps.htm, with a
filtering ($ grep -v "1-0\|0-1" traps2.txt | sed "/^$/d" | sed G) and
less than a dozen minor editions, to a PGN file.

P.S.: Sorry for the "engrish".
--
César A. K. Grossmann
 
G

Guest

Guest
Archived from groups: rec.games.chess.computer (More info?)

On 2005-04-15, WRobinson <cesarakg@gmail.com> wrote:

> I had some friend written some AWK code to do the same, you can see it
> here (I added the Copyright note, and I'm assuming it has no
> restriction to distribution and use):

It's so simple that copyright laws hardly protects it anyway.

--
Ari Makela no escaping it -
hauva@arska.org I must step on fallen leaves
http://arska.org/hauva/ to take this path (Suzuki Majoko)