PGN to FEn

steve

Distinguished
Sep 10, 2003
2,366
0
19,780
Archived from groups: rec.games.chess.computer (More info?)

Hi!

I've been looking for a very simple program that converts PGN to FEN. It
can be a DOS app or linux or even windows.

All I need is to convert several 1000 PGN formats to FEN.

I noted and have software that does this one file at a time. I want to
write a script to convert them.

Ex: I have a number of Kasparov and Anand etc PGN files. However, I want
them in FEN format. I like the PGN format when I sit down and study a game.
However when I want the computer to analyze a position I don't want to type
each one in, I can make mistakes in the process.

Also, I want to use the FEN format to train a program I've been working on
learning strategies. FEN is the easiest for me. I am trying to experiment
with a new learning algorithm which I've been working on for a while. I
want to compile this data from FEN and have my program try to learn
something from it.

I've an idea that may sound odd. I am using traditional analysis to compute
a position. I spent about 3 years working on this style and using Dr.
Hyatts insight regarding his ingenious bitboard method which took me a while
to comprehend. Now I have something that plays pretty well. As an
experiment, I want to add to the evalulation routine (which is very simple
and I kept it simple for this exact purpose), I want to organize various
games and try to analyze them to say 4 moves deep. Then use some statistical
analysis and learning algorithms to locate trends. Use this info as what I
call the 'creative' feature. Add this 'creative' feature (value) to the
simple analysis and see if the machine begins to learn. The general idea is
that the 'creative' feature(component) will try to come up with the same
value as if it were analyzed by traditional methods. In short, it'd be
interesting to find a set of rules from a self-learning system that doesn't
require to analyze 3 to 4 moves deep but can find the same value within one
move deep.

Therefore, a large sample of FEN would be extremely helpful.

Please is there a simple solution to convert PGN to FEN
-OR-
Is there a db filled w/FEN formats with Grandmasters playing?

If there is a FEN db I can download where can I find it?

I really would appreciate any help.
Steve
 
Archived from groups: rec.games.chess.computer (More info?)

And if you know Perl, I can make the same offer...

--hsm

Ari Makela wrote:
> On 2005-04-21, Steve <scp2000@hotmail.com> wrote:
>
> > Please is there a simple solution to convert PGN to FEN
>
> How do you define converting PGN to FEN? Every position in a game or
the
> last position converted to FEN?
>
> If you know Python I have a python library which could be useful for
> you. It's a derivative of Erik Max Francis's python library.
>
> --
> Ari Makela no escaping it
-
> hauva@arska.org I must step on fallen
leaves
> http://arska.org/hauva/ to take this path (Suzuki
Majoko)
 
Archived from groups: rec.games.chess.computer (More info?)

On 2005-04-21, Steve <scp2000@hotmail.com> wrote:

> Please is there a simple solution to convert PGN to FEN

How do you define converting PGN to FEN? Every position in a game or the
last position converted to FEN?

If you know Python I have a python library which could be useful for
you. It's a derivative of Erik Max Francis's python library.

--
Ari Makela no escaping it -
hauva@arska.org I must step on fallen leaves
http://arska.org/hauva/ to take this path (Suzuki Majoko)
 
Archived from groups: rec.games.chess.computer (More info?)

Steve wrote:
> Hi!
>
> I've been looking for a very simple program that converts PGN to FEN.
It
> can be a DOS app or linux or even windows.
>
> All I need is to convert several 1000 PGN formats to FEN.
>
> I noted and have software that does this one file at a time. I want
to
> write a script to convert them.
>
> Ex: I have a number of Kasparov and Anand etc PGN files. However, I
want
> them in FEN format. I like the PGN format when I sit down and study
a game.
> However when I want the computer to analyze a position I don't want
to type
> each one in, I can make mistakes in the process.
>
> Also, I want to use the FEN format to train a program I've been
working on
> learning strategies. FEN is the easiest for me. I am trying to
experiment
> with a new learning algorithm which I've been working on for a while.
I
> want to compile this data from FEN and have my program try to learn
> something from it.
>
> I've an idea that may sound odd. I am using traditional analysis to
compute
> a position. I spent about 3 years working on this style and using
Dr.
> Hyatts insight regarding his ingenious bitboard method which took me
a while
> to comprehend. Now I have something that plays pretty well. As an
> experiment, I want to add to the evalulation routine (which is very
simple
> and I kept it simple for this exact purpose), I want to organize
various
> games and try to analyze them to say 4 moves deep. Then use some
statistical
> analysis and learning algorithms to locate trends. Use this info as
what I
> call the 'creative' feature. Add this 'creative' feature (value) to
the
> simple analysis and see if the machine begins to learn. The general
idea is
> that the 'creative' feature(component) will try to come up with the
same
> value as if it were analyzed by traditional methods. In short, it'd
be
> interesting to find a set of rules from a self-learning system that
doesn't
> require to analyze 3 to 4 moves deep but can find the same value
within one
> move deep.
>
> Therefore, a large sample of FEN would be extremely helpful.
>
> Please is there a simple solution to convert PGN to FEN
> -OR-
> Is there a db filled w/FEN formats with Grandmasters playing?
>
> If there is a FEN db I can download where can I find it?
>
> I really would appreciate any help.
> Steve


Hi steve,

Some years ago, I compiled a FEN database, if I remember well it
contains more than 160 millions unique positions. Actually it is on a
CD at home, if you want I can put it on a ftp for you to download it.
(send me an email in that case)


Mathieu P.
mathieu dot page at [google's email service] dot com
 
Archived from groups: rec.games.chess.computer (More info?)

Hello
I think you have here is the solution:
http://www.7sun.com/chess/index.php
Regards
Enzo

"hsmyers" <hsmyers@sdragons.com> a écrit dans le message de news:
1114095462.326005.24920@g14g2000cwa.googlegroups.com...
> And if you know Perl, I can make the same offer...
>
> --hsm
>
> Ari Makela wrote:
>> On 2005-04-21, Steve <scp2000@hotmail.com> wrote:
>>
>> > Please is there a simple solution to convert PGN to FEN
>>
>> How do you define converting PGN to FEN? Every position in a game or
> the
>> last position converted to FEN?
>>
>> If you know Python I have a python library which could be useful for
>> you. It's a derivative of Erik Max Francis's python library.
>>
>> --
>> Ari Makela no escaping it
> -
>> hauva@arska.org I must step on fallen
> leaves
>> http://arska.org/hauva/ to take this path (Suzuki
> Majoko)
>
 
Archived from groups: rec.games.chess.computer (More info?)

"Steve" <scp2000@hotmail.com> wrote in message
news:LMmdnXXGxOAwrPrfRVn-3g@adelphia.com...
> Hi!
>
> I've been looking for a very simple program that converts PGN to FEN. It
> can be a DOS app or linux or even windows.
>
> All I need is to convert several 1000 PGN formats to FEN.
>
> I noted and have software that does this one file at a time. I want to
> write a script to convert them.
>
> Ex: I have a number of Kasparov and Anand etc PGN files. However, I want
> them in FEN format. I like the PGN format when I sit down and study a
game.
> However when I want the computer to analyze a position I don't want to
type
> each one in, I can make mistakes in the process.

While not a simple program (nor free) Bookup 2000 Professional will import
PGN and then export to EPD which is basically FEN. It has the advantage of
exporting each unique position only once.


Mike Leahy
"The Database Man!"
www.bookup.com
www.chessopeningspgn.com
 
Archived from groups: rec.games.chess.computer (More info?)

On 2005-04-22, Mike Leahy <mikeleahynospam@bookuppro.com> wrote:

> It has the advantage of
> exporting each unique position only once.

If I understood correctly what Steve wanted (one position as FEN per
line) this is not a problem because one of the platforms was linux.
The command "sort -u" sorts the lines and prints out only the unique
lines.

--
Ari Makela no escaping it -
hauva@arska.org I must step on fallen leaves
http://arska.org/hauva/ to take this path (Suzuki Majoko)
 
Archived from groups: rec.games.chess.computer (More info?)

On Fri, 22 Apr 2005 at 08:14 GMT, Ari Makela wrote:
> On 2005-04-22, Mike Leahy <mikeleahynospam@bookuppro.com> wrote:
>
>> It has the advantage of
>> exporting each unique position only once.
>
> If I understood correctly what Steve wanted (one position as FEN per
> line) this is not a problem because one of the platforms was linux.
> The command "sort -u" sorts the lines and prints out only the unique
> lines.

If you want to keep the lines in the original order:

awk 'x[$0]++ == 0' FILENAME > NEWFILE


--
Chris F.A. Johnson http://cfaj.freeshell.org
==================================================================
Shell Scripting Recipes: A Problem-Solution Approach, Apress, 1999
http://www.torfree.net/~chris/books/ssr.html
 
Archived from groups: rec.games.chess.computer (More info?)

"Ari Makela" <hauva@lagavulin.sappho.net> wrote in message
news:slrnd6hcjn.qa1.hauva@lagavulin.sappho.net...
> On 2005-04-22, Mike Leahy <mikeleahynospam@bookuppro.com> wrote:
>
> > It has the advantage of
> > exporting each unique position only once.
>
> If I understood correctly what Steve wanted (one position as FEN per
> line) this is not a problem because one of the platforms was linux.
> The command "sort -u" sorts the lines and prints out only the unique
> lines.

Handy.

But I doubt it took each FEN and removed those that are duplicates because
of mirrors and/or color reversals. :)


Mike Leahy
"The Database Man!"
www.bookup.com
www.chessopeningspgn.com
 
Archived from groups: rec.games.chess.computer (More info?)

there is the SAN kit by Mr. Edwards,
and at http://www.7sun.com/chess/index.php
there is the program PGN2FEN.
I always use the SAN kit. It is a DOS command line program, but it has a lot
of features.
Wijnand.

"Steve" <scp2000@hotmail.com> wrote in message
news:LMmdnXXGxOAwrPrfRVn-3g@adelphia.com...
> Hi!
>
> I've been looking for a very simple program that converts PGN to FEN. It
> can be a DOS app or linux or even windows.
>
> All I need is to convert several 1000 PGN formats to FEN.
>
> I noted and have software that does this one file at a time. I want to
> write a script to convert them.
>
> Ex: I have a number of Kasparov and Anand etc PGN files. However, I want
> them in FEN format. I like the PGN format when I sit down and study a
game.
> However when I want the computer to analyze a position I don't want to
type
> each one in, I can make mistakes in the process.
>
> Also, I want to use the FEN format to train a program I've been working on
> learning strategies. FEN is the easiest for me. I am trying to
experiment
> with a new learning algorithm which I've been working on for a while. I
> want to compile this data from FEN and have my program try to learn
> something from it.
>
> I've an idea that may sound odd. I am using traditional analysis to
compute
> a position. I spent about 3 years working on this style and using Dr.
> Hyatts insight regarding his ingenious bitboard method which took me a
while
> to comprehend. Now I have something that plays pretty well. As an
> experiment, I want to add to the evalulation routine (which is very simple
> and I kept it simple for this exact purpose), I want to organize various
> games and try to analyze them to say 4 moves deep. Then use some
statistical
> analysis and learning algorithms to locate trends. Use this info as what
I
> call the 'creative' feature. Add this 'creative' feature (value) to the
> simple analysis and see if the machine begins to learn. The general idea
is
> that the 'creative' feature(component) will try to come up with the same
> value as if it were analyzed by traditional methods. In short, it'd be
> interesting to find a set of rules from a self-learning system that
doesn't
> require to analyze 3 to 4 moves deep but can find the same value within
one
> move deep.
>
> Therefore, a large sample of FEN would be extremely helpful.
>
> Please is there a simple solution to convert PGN to FEN
> -OR-
> Is there a db filled w/FEN formats with Grandmasters playing?
>
> If there is a FEN db I can download where can I find it?
>
> I really would appreciate any help.
> Steve
>
>
 
Archived from groups: rec.games.chess.computer (More info?)

Steve wrote:

> I've been looking for a very simple program that converts PGN to FEN. It
> can be a DOS app or linux or even windows.

See other answers. I can add pgn-extract that does a lot of PGN
conversions.

> Also, I want to use the FEN format to train a program I've been working on
> learning strategies. FEN is the easiest for me. I am trying to experiment
> with a new learning algorithm which I've been working on for a while. I
> want to compile this data from FEN and have my program try to learn
> something from it.

I am in the same situation for my program. I came accross EPD however
that is an extension to FEN. (Cut the last 2 parts and add some new ones).

I am still trying to figure out how you actually use this together with
some scripts to evaluate your program. There is plenty of information
available on those EPD testsuites.

> I've an idea that may sound odd. I am using traditional analysis to compute
> a position. I spent about 3 years working on this style and using Dr.
> Hyatts insight regarding his ingenious bitboard method which took me a while
> to comprehend. Now I have something that plays pretty well. As an
> experiment, I want to add to the evalulation routine (which is very simple
> and I kept it simple for this exact purpose), I want to organize various
> games and try to analyze them to say 4 moves deep.

We need to talk about this... I plan trying 0 moves deep statistical
analysis.


http://www.internetcontact.be/~macchess
Yves