Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old March 7th 04, 03:26 AM
Mogath3
 
Posts: n/a
Default 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

  #2   Report Post  
Old March 7th 04, 03:56 AM
none
 
Posts: n/a
Default 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.
  #4   Report Post  
Old March 7th 04, 08:29 AM
Ralph Jones
 
Posts: n/a
Default 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


  #5   Report Post  
Old March 7th 04, 10:40 AM
Ari Makela
 
Posts: n/a
Default PGN to Fen conversion

In article , 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 -
I must step on fallen leaves
http://arska.org/hauva/ to take this path (Suzuki Majoko)



  #6   Report Post  
Old March 7th 04, 12:43 PM
RPM1
 
Posts: n/a
Default PGN to Fen conversion


"Ari Makela" wrote ...
In article , 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.



Grep for windows:
http://www.interlog.com/~tcharron/grep.html

I use it all the time. (An aside: it has a nice switch -S that searches
subdirectories)

Also if you run into tasks like this every once in a while you
might want to look into learning the programming language,
Python. Tasks like this can be done in minutes, (even for
a newbie).

www.python.org

Patrick



  #7   Report Post  
Old March 7th 04, 12:45 PM
Joost de Heer
 
Posts: n/a
Default PGN to Fen conversion

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.


find "string" filepattern. Unfortunately not recursive, and not sure it can
handle regexps.

I use it all the time. (An aside: it has a nice switch -S that searches
subdirectories)


You sure it's -S? In GNU grep it's -R.

Joost
--
Du hast mein Herz zerrissen, meine Seele geraubt
Das es so enden würde hätt` ich nie geglaubt [Aus der Ruinen -]
Ohne Rücksicht auf Verluste, hast Du meine Welt zerstört [L'Âme Immortelle]
Eine Welt, die vor kurzem nur uns beiden hat gehört
  #10   Report Post  
Old March 7th 04, 07:20 PM
Mike Leahy
 
Posts: n/a
Default PGN to Fen conversion


"Mogath3" wrote in message
...
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


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PGN to Chessbase conversion Andy rec.games.chess.computer (Computer Chess) 2 September 19th 03 12:23 AM
PGN to CBH file conversion Avanti rec.games.chess.analysis (Chess Analysis) 3 August 2nd 03 08:51 AM


All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004-2019 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017