I have a pgn file with a lot of Grunfeld variations(called game2.pgn) and I would like to separate them all in different pgn files. I've tried but I don't understand very well the instructions.
1 Answer
One option would be to run pgn-extract with the -E3 option as that will separate games into individual files whose name would be D85.pgn, D86.pgn, etc. If the games do not already have ECO tags in them then you will need to include the -e option. So, assuming Windows usage with a Cmd window open where pgn-extract.exe is located, the command would be:
.\pgn-extract.exe -e -E3 game2.pgn
An alternative would be to create a separate file for each opening position you wish to match and then use pgn-extract with the -x flag. For instance, you might put the following sequence in a file called ex-classical.txt (the name doesn't matter):
d4 Nf6 c4 g6 Nc3 d5 cxd5 Nxd5 e4 Nxc3 bxc3 Bg7 Bc4
to find games matching the Exchange Classical Variation and then run:
.\pgn-extract.exe -x ex-classical.txt -o ex-classical.pgn game2.pgn
would use those moves to output matching games to the file ex-classical.pgn.