Answers.Body: <p>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:</p>
  <pre><code>.\pgn-extract.exe -e -E3 game2.pgn
  </code></pre>
  <p>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):</p>
  <pre><code>d4 Nf6 c4 g6 Nc3 d5 cxd5 Nxd5 e4 Nxc3 bxc3 Bg7 Bc4
  </code></pre>
  <p>to find games matching the Exchange Classical Variation and then run:</p>
  <pre><code>.\pgn-extract.exe -x ex-classical.txt -o ex-classical.pgn game2.pgn
  </code></pre>
  <p>would use those moves to output matching games to the file ex-classical.pgn.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-25T08:13:48.747Z
Answers.LastActivityDate: 2024-07-25T08:13:48.747Z
Answers.UserDisplayName: kentdjb
Body: <p>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.</p>
  
Tags: <database><pgn><pgn-extract>
Title: How to use Extract pgn
ThreadText: # How to use Extract pgn
  
  (Asked by: username_0 on 2024-07-24)
  
  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.
  
  **Tags:** database, pgn, pgn-extract
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-07-25. Score: 1
  
  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.
  
  
  ---
  
  