Converting PGN to CSV file

Discussion of chess software programming and technical issues.

Moderator: Ras

Jon12345
Posts: 80
Joined: Tue May 11, 2010 6:18 pm

Re: Converting PGN to CSV file

Post by Jon12345 »

I tried that but I got the following error:

'pgn-extract' is not recognized as operable program or batch file.

I can't see any exe files. Lots of H Files whatever they are.

Have I downloaded the wrong thing?

I downloaded pgn-extract-16-7.zip
Jon
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Converting PGN to CSV file

Post by Don »

Jon12345 wrote:I tried that but I got the following error:

'pgn-extract' is not recognized as operable program or batch file.

I can't see any exe files. Lots of H Files whatever they are.

Have I downloaded the wrong thing?

I downloaded pgn-extract-16-7.zip
That just means it's not it your path or in the directory you are in.

I am not a windows user so it's rather difficult to explain this to you in a way that is very understandable and will not frustrate us both.
Jon12345
Posts: 80
Joined: Tue May 11, 2010 6:18 pm

Re: Converting PGN to CSV file

Post by Jon12345 »

I was in the path. I went to the folder where I extracted the pgn extractor files. Then I put the pgn file in that directory. But there is not exe or bat file to execute.
Jon
Dann Corbit
Posts: 12791
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Converting PGN to CSV file

Post by Dann Corbit »

Don wrote:
Jon12345 wrote:I tried that but I got the following error:

'pgn-extract' is not recognized as operable program or batch file.

I can't see any exe files. Lots of H Files whatever they are.

Have I downloaded the wrong thing?

I downloaded pgn-extract-16-7.zip
That just means it's not it your path or in the directory you are in.

I am not a windows user so it's rather difficult to explain this to you in a way that is very understandable and will not frustrate us both.
I think he needs to extract the files from the zip archive.
Jon12345
Posts: 80
Joined: Tue May 11, 2010 6:18 pm

Re: Converting PGN to CSV file

Post by Jon12345 »

The files were extracted to a folder. And PGN file placed in there too.
Jon
Dann Corbit
Posts: 12791
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Converting PGN to CSV file

Post by Dann Corbit »

Jon12345 wrote:The files were extracted to a folder. And PGN file placed in there too.
Perhaps you downloaded a source only archive.
Here is a 64 bit version compiled by me (it has a new name of eco):
http://cap.connx.com/chess-engines/new- ... co.exe.bz2
It has been compressed with bzip2.

If you do not have a 64 bit OS, you can use this version:
ftp://ftp.cs.kent.ac.uk/pub/djb/Extract ... t-16-7.exe
User avatar
jshriver
Posts: 1358
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Converting PGN to CSV file

Post by jshriver »

PGN parsing really isn't trivial, or perhaps I suck.

Long algebraic is nice and is easy parseable. e2e4 x[pos]y[pos]. However it's not that easy. When you want to read in pgn files, or parse input from a game the gramar at least to me can be tricky. Not only do you have to parse and realise pxe5 or whatever, you almost need to have your own legal move generator to parse and say is this possible. Cause in the case you have Nxe6, where both knights can move to e6. It become extremely confusing. In the years lurking posting here, still haven't figured that out.


Really wish there was a BSD Flex definition for PGN that could be incorporated into an engine or code.
-Josh
Dann Corbit
Posts: 12791
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Converting PGN to CSV file

Post by Dann Corbit »

jshriver wrote:PGN parsing really isn't trivial, or perhaps I suck.

Long algebraic is nice and is easy parseable. e2e4 x[pos]y[pos]. However it's not that easy. When you want to read in pgn files, or parse input from a game the gramar at least to me can be tricky. Not only do you have to parse and realise pxe5 or whatever, you almost need to have your own legal move generator to parse and say is this possible. Cause in the case you have Nxe6, where both knights can move to e6. It become extremely confusing. In the years lurking posting here, still haven't figured that out.


Really wish there was a BSD Flex definition for PGN that could be incorporated into an engine or code.
-Josh
Gnuchess 5.07 comes with a Lex file lexpgn.l and lex is compatible with Flex, IIRC.
Dann Corbit
Posts: 12791
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Converting PGN to CSV file

Post by Dann Corbit »

Dann Corbit wrote:
jshriver wrote:PGN parsing really isn't trivial, or perhaps I suck.

Long algebraic is nice and is easy parseable. e2e4 x[pos]y[pos]. However it's not that easy. When you want to read in pgn files, or parse input from a game the gramar at least to me can be tricky. Not only do you have to parse and realise pxe5 or whatever, you almost need to have your own legal move generator to parse and say is this possible. Cause in the case you have Nxe6, where both knights can move to e6. It become extremely confusing. In the years lurking posting here, still haven't figured that out.


Really wish there was a BSD Flex definition for PGN that could be incorporated into an engine or code.
-Josh
Gnuchess 5.07 comes with a Lex file lexpgn.l and lex is compatible with Flex, IIRC.
Important note:
Gnuchess is GPL, so your project will become GPL if you use that file.