View Single Post
  #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