Chess Forum
Promoting chess discussion.

Free Avlerchess Glass Chess Set - Find out how you can get a free glass chess set from us.


Main
Date: 07 Mar 2004 03:26:26
From: Mogath3
Subject: PGN to Fen conversion
I have a file of positions in pgn format, 1154 of them to be exact. Here is an
example of one:

[Event "Combination Challenge!"]
[Site "?"]
[Date "1992.??.??"]
[Round "?"]
[White "01"]
[Black "?"]
[Result "*"]
[SetUp "1"]
[FEN "3rn1k1/p4ppp/1p4b1/2p1Q3/2P1P3/P4P2/1B1qBP1P/1R5K w - - 0 1"]
[PlyCount "0"]
[EventDate "1991.??.??"]
[SourceDate "2002.08.06"]

What I want to do is just have the fen line without everything else. I tried
the program pgn2fen without success. I don't want to have to edit out
everything except the fen line with a word processor. Basically I want 1154 fen
lines. How do I go about doing this? Any help anyone can provide is greatly
appreciated. Thanks very much.

Regards,
Jeff



 
Date: 07 Mar 2004 03:56:36
From: none
Subject: Re: PGN to Fen conversion
Mogath3 wrote:
> I have a file of positions in pgn format, 1154 of them to be exact. Here is an
> example of one:
>
> [Event "Combination Challenge!"]
> [Site "?"]
> [Date "1992.??.??"]
> [Round "?"]
> [White "01"]
> [Black "?"]
> [Result "*"]
> [SetUp "1"]
> [FEN "3rn1k1/p4ppp/1p4b1/2p1Q3/2P1P3/P4P2/1B1qBP1P/1R5K w - - 0 1"]
> [PlyCount "0"]
> [EventDate "1991.??.??"]
> [SourceDate "2002.08.06"]
>
> What I want to do is just have the fen line without everything else. I tried
> the program pgn2fen without success. I don't want to have to edit out
> everything except the fen line with a word processor. Basically I want 1154 fen
> lines. How do I go about doing this? Any help anyone can provide is greatly
> appreciated. Thanks very much.
>
> Regards,
> Jeff
>
Find someone who uses unix/linux. Send them the file. Get them to do a
"grep" on the word FEN. Problem solved. :) Will take under 2 seconds.


 
Date: 06 Mar 2004 22:55:54
From: Ricky Robbins
Subject: Re: PGN to Fen conversion
On 07 Mar 2004 03:26:26 GMT, [email protected] (Mogath3) wrote:

>What I want to do is just have the fen line without everything else. I tried
>the program pgn2fen without success. I don't want to have to edit out
>everything except the fen line with a word processor. Basically I want 1154 fen
>lines. How do I go about doing this? Any help anyone can provide is greatly
>appreciated. Thanks very much.

If you have Excel, open with Excel, select all, sort, then cut out the
FEN section and past into a text document.

Ricky


 
Date: 07 Mar 2004 01:29:55
From: Ralph Jones
Subject: Re: PGN to Fen conversion
If you're on a *nix system (or have access to one), you could just use the
"grep 'FEN' <pgnfile > >> <fenfile>" command (if it's just one file), or if
numerous files...put them all in one directory, then in the directory use
"grep 'FEN' * >> <fenfile>"

In windows, I'm sure there's something similar you could do from a DOS
prompt (it's just been so long since I looked at DOS I haven'ta clue).

Mogath3 wrote:

> I have a file of positions in pgn format, 1154 of them to be exact. Here
> is an example of one:
>
> [Event "Combination Challenge!"]
> [Site "?"]
> [Date "1992.??.??"]
> [Round "?"]
> [White "01"]
> [Black "?"]
> [Result "*"]
> [SetUp "1"]
> [FEN "3rn1k1/p4ppp/1p4b1/2p1Q3/2P1P3/P4P2/1B1qBP1P/1R5K w - - 0 1"]
> [PlyCount "0"]
> [EventDate "1991.??.??"]
> [SourceDate "2002.08.06"]
>
> What I want to do is just have the fen line without everything else. I
> tried the program pgn2fen without success. I don't want to have to edit
> out everything except the fen line with a word processor. Basically I want
> 1154 fen lines. How do I go about doing this? Any help anyone can provide
> is greatly appreciated. Thanks very much.
>
> Regards,
> Jeff



  
Date: 07 Mar 2004 10:40:12
From: Ari Makela
Subject: Re: PGN to Fen conversion
In article <[email protected] >, Ralph Jones wrote:
> If you're on a *nix system (or have access to one), you could just use the
> "grep 'FEN' <pgnfile> >> <fenfile>" command (if it's just one file), or if
> numerous files...put them all in one directory, then in the directory use
> "grep 'FEN' * >> <fenfile>"

It's better to use anchors: regular expressions become much faster:

grep '^\[FEN' *.pgn >> fenfile

> In windows, I'm sure there's something similar you could do from a DOS
> prompt (it's just been so long since I looked at DOS I haven'ta clue).

Actually I don't think there is. But you can find several sets of unix
tools for Windows, Cygwin is one. It's a good idea if one needs to
manipulate text. Mind you, I haven't used Windows for years so I really
cannot be more specific.

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



   
Date: 07 Mar 2004 20:09:06
From: Linares__Lulls
Subject: Re: Bookup is a rip off and Mike Leahy is a liar and a thief!
LOL

"Nonyz" <[email protected] > wrote in message
news:[email protected]...
> "Mike Leahy" <[email protected]> wrote in message
news:<[email protected] >...
>
> > Who precisely are you comparing me with?
> >
> > Mike Leahy
> > "The Database Man!"
>
> I'm generally reminded of you when I get 'Viagra' or 'Free Sex Chat'
> mails in my inbox. So, which spammer/pornographer would you like to be
> compared to... precicely? Would you be nice enough to gimme an
> introduction to one of your buddies before I can make that comparison?




 
Date: 07 Mar 2004 10:50:55
From: Michael Byrne
Subject: Re: PGN to Fen conversion
[email protected] (Mogath3) wrote in message news:<[email protected] >...
> I have a file of positions in pgn format, 1154 of them to be exact. Here is an
> example of one:
>
> [Event "Combination Challenge!"]
> [Site "?"]
> [Date "1992.??.??"]
> [Round "?"]
> [White "01"]
> [Black "?"]
> [Result "*"]
> [SetUp "1"]
> [FEN "3rn1k1/p4ppp/1p4b1/2p1Q3/2P1P3/P4P2/1B1qBP1P/1R5K w - - 0 1"]
> [PlyCount "0"]
> [EventDate "1991.??.??"]
> [SourceDate "2002.08.06"]
>
> What I want to do is just have the fen line without everything else. I tried
> the program pgn2fen without success. I don't want to have to edit out
> everything except the fen line with a word processor. Basically I want 1154 fen
> lines. How do I go about doing this? Any help anyone can provide is greatly
> appreciated. Thanks very much.
>
> Regards,
> Jeff


Hi Jeff-

J.W. Cleveland did post this nifty DOS solution on "ccc"

Mike
==============================================================

If you are running windows, open a dos box, cd to the directory where your file
is, and type:
find "[FEN" myfile.pgn >fen.txt
where myfile.pgn is the name of the pgn file. This should put just the fen lines
in fen.txt. Load this file in a word processor, do 2 replace all to get rid of
the [FEN " and the "] save it as text and you should have it.


===============================================================


 
Date: 07 Mar 2004 10:50:56
From: Michael Byrne
Subject: Re: PGN to Fen conversion
[email protected] (Mogath3) wrote in message news:<[email protected] >...
> I have a file of positions in pgn format, 1154 of them to be exact. Here is an
> example of one:
>
> [Event "Combination Challenge!"]
> [Site "?"]
> [Date "1992.??.??"]
> [Round "?"]
> [White "01"]
> [Black "?"]
> [Result "*"]
> [SetUp "1"]
> [FEN "3rn1k1/p4ppp/1p4b1/2p1Q3/2P1P3/P4P2/1B1qBP1P/1R5K w - - 0 1"]
> [PlyCount "0"]
> [EventDate "1991.??.??"]
> [SourceDate "2002.08.06"]
>
> What I want to do is just have the fen line without everything else. I tried
> the program pgn2fen without success. I don't want to have to edit out
> everything except the fen line with a word processor. Basically I want 1154 fen
> lines. How do I go about doing this? Any help anyone can provide is greatly
> appreciated. Thanks very much.
>
> Regards,
> Jeff


Hi Jeff-

J.W. Cleveland did post this nifty DOS solution on "ccc"

Mike
==============================================================

If you are running windows, open a dos box, cd to the directory where your file
is, and type:
find "[FEN" myfile.pgn >fen.txt
where myfile.pgn is the name of the pgn file. This should put just the fen lines
in fen.txt. Load this file in a word processor, do 2 replace all to get rid of
the [FEN " and the "] save it as text and you should have it.


===============================================================


 
Date: 07 Mar 2004 19:20:53
From: Mike Leahy
Subject: Re: PGN to Fen conversion

"Mogath3" <[email protected] > wrote in message
news:[email protected]...
> I have a file of positions in pgn format, 1154 of them to be exact. Here
is an
> example of one:
>
> [Event "Combination Challenge!"]

> What I want to do is just have the fen line without everything else. I
tried
> the program pgn2fen without success. I don't want to have to edit out
> everything except the fen line with a word processor. Basically I want
1154 fen
> lines. How do I go about doing this? Any help anyone can provide is
greatly
> appreciated. Thanks very much.

Hey Jeff,

Each of the editing solutions posted here should work. If you Bookup 2000
Professional you can import them into an ebook and then export them as
EPD which is just the FEN part.

Mike Leahy
"The Database Man!"
www.bookup.com