by Anonymous » 23 Aug 2005, 18:24
Yace can do something very similar (probably not documented)
At the yace-prompt
carlos_pgn games.pgn new.txt s n n 0 0
new.txt will look like
[TimeControl "900+3"]
e4 e5 Nf3 Nc6 Bb5 a6 Ba4 Bd6 O-O Nge7 c3 O-O d4 b5 Bc2 Bb7 Bg5 [..., everything on one line]
[TimeControl "900+3"]
e4 c5 Nf3 e6 d4 cxd4 Nxd4 Nc6 Nc3 a6 Nxc6 bxc6 Bd3 d5 O-O Nf6 ...
...
Annotations (!, ?, ...) in the original PGN will get lost. Using k instead of n in the above command will keep the annotations.
If you do
carlos_pgn games.pgn new.txt s !! n 0 30
only 30 plies will be written, and each white move will get a !! attached. You can proably see the trick - when you change the second "n" to something else, every black move will get that attached, so for example
carlos_pgn games.pgn new.txt s n ! 0 0
will attach a ! to any black move. There are many more options (most of which I forgot ...).
This can also be useful for book generation purposes, especially, when you are going to prepare a white and a black repertoire by some other (graphical) tools.
Getting rid of the [...] lines (the last PGN tag will be used) could easily be done in an automatic way by sed, for example (but because of the quoting issues, I am not prepared to show the correct command without trying).
Changing to coordinate notation instead of SAN can be done by issuing
gui ChessAcademy
first.
If you wonder about the name of the command, "carlos_pgn" - I had implemented it for Carlos Pesce, a well known book author.
Regards,
Dieter