View Single Post
  #6   Report Post  
Old March 7th 04, 12:43 PM
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

"grep 'FEN' pgnfile fenfile" command (if it's just one file), or

numerous files...put them all in one directory, then in the directory

"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:

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

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).