Answers.Body: <p>It looks like the following achieves what I need:</p>
  <pre><code>(pgn-extract -c a.pgn -D b.pgn; pgn-extract -c b.pgn -D a.pgn) &gt; c.pgn
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-02T11:03:15.893Z
Answers.LastActivityDate: 2024-05-02T13:02:59.490Z
Answers.LastEditDate: 2024-05-02T13:02:59.490Z
Answers.UserDisplayName: Michał K.
Body: <p>I am trying to use pgn-extract to extract games that exist exactly once in two PGN files. I thought the following would work:</p>
  <pre><code>pgn-extract -U a.pgn b.pgn -o/dev/null -nonly_once.pgn
  </code></pre>
  <p>but it simply removes duplicates like <code>-D</code> would do and keeps the games that occur in both input files.</p>
  <p>Is it possible with <code>pgn-extract</code>?</p>
  
Tags: <pgn><pgn-extract>
Title: How to extract games occurring only once from PGN file(s)?
ThreadText: # How to extract games occurring only once from PGN file(s)?
  
  (Asked by: username_0 on 2024-05-02)
  
  I am trying to use pgn-extract to extract games that exist exactly once in two PGN files. I thought the following would work:
  
  ```
  pgn-extract -U a.pgn b.pgn -o/dev/null -nonly_once.pgn
  
  ```
  
  but it simply removes duplicates like `-D` would do and keeps the games that occur in both input files.
  
  Is it possible with `pgn-extract`?
  
  **Tags:** pgn, pgn-extract
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-05-02. Score: 2
  
  It looks like the following achieves what I need:
  
  ```
  (pgn-extract -c a.pgn -D b.pgn; pgn-extract -c b.pgn -D a.pgn) > c.pgn
  
  ```
  
  
  ---
  
  