Body: <p>I have a huge 100M games in one PGN file - some % of it is stockfish evaluated, I want to use pgn-extract to extract those evaluated only, Is there a way of doing so?</p>
  <p>examples of games with and without evaluation:</p>
  <p><a href="https://gist.github.com/int8/aa7fdbda7c449d018237d16e0a80f6b8" rel="nofollow noreferrer">game with no evaluation</a></p>
  <p><a href="https://gist.github.com/int8/6b723c72af00b9bc7802d014020535fd" rel="nofollow noreferrer">game with evaluation</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-05T10:38:53.817Z
Comments.Text: Have you read the [pgn-extract](https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html) documentation?
Comments.UserDisplayName: ferdy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-05T10:42:54.243Z
Comments.Text: I have. I tried `-trules` where `rules` is a file with regex `*eval*` - this did not help
Comments.UserDisplayName: Kamil Czarnogorski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-05T11:19:08.650Z
Comments.Text: Could you post 1 game with annotation and 1 game without annotation?
Comments.UserDisplayName: ferdy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-05T17:09:45.550Z
Comments.Text: sure, 
  
  [game with no evaluation](https://gist.github.com/int8/aa7fdbda7c449d018237d16e0a80f6b8)
  
   [game with evaluation](https://gist.github.com/int8/6b723c72af00b9bc7802d014020535fd)
Comments.UserDisplayName: Kamil Czarnogorski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-05T17:48:56.677Z
Comments.Text: now by looking at PGN specs It seems I really want to search "by comments"
Comments.UserDisplayName: Kamil Czarnogorski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-05T19:48:56.500Z
Comments.Text: ended up going for cumbersome (but so far working) `awk 'BEGIN { OFS = "\[Event" } ; { RS = "\[Event" } ; /%eval/ { print "[Event" $0  }' input.pgn`
Comments.UserDisplayName: Kamil Czarnogorski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-05T20:29:27.167Z
Comments.Text: pgn-extract doesn't have an option for that but you could use it as part of a pipeline to achieve what you want:
  `pgn-extract -w10000 input.pgn | grep '%eval' | pgn-extract --output output.pgn`
  That way, you could add further selection criteria to the first pass if required.
Comments.UserDisplayName: kentdjb
Tags: <computer-chess><evaluation>
Title: How to filter out games with evaluation from large PGN file?
ThreadText: # How to filter out games with evaluation from large PGN file?
  
  (Asked by: username_0 on 2022-02-05)
  
  I have a huge 100M games in one PGN file - some % of it is stockfish evaluated, I want to use pgn-extract to extract those evaluated only, Is there a way of doing so?
  
  examples of games with and without evaluation:
  
  [game with no evaluation](https://gist.github.com/int8/aa7fdbda7c449d018237d16e0a80f6b8)
  
  [game with evaluation](https://gist.github.com/int8/6b723c72af00b9bc7802d014020535fd)
  
  **Tags:** computer-chess, evaluation
  
  > **Comments:**
  > **username_1**: Have you read the [pgn-extract](https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html) documentation?  
  > **username_0**: I have. I tried `-trules` where `rules` is a file with regex `*eval*` - this did not help  
  > **username_1**: Could you post 1 game with annotation and 1 game without annotation?  
  > **username_0**: sure,   [game with no evaluation](https://gist.github.com/int8/aa7fdbda7c449d018237d16e0a80f6b8)   [game with evaluation](https://gist.github.com/int8/6b723c72af00b9bc7802d014020535fd)  
  > **username_0**: now by looking at PGN specs It seems I really want to search "by comments"  
  > **username_0**: ended up going for cumbersome (but so far working) `awk 'BEGIN { OFS = "\[Event" } ; { RS = "\[Event" } ; /%eval/ { print "[Event" $0  }' input.pgn`  
  > **username_2**: pgn-extract doesn't have an option for that but you could use it as part of a pipeline to achieve what you want: `pgn-extract -w10000 input.pgn | grep '%eval' | pgn-extract --output output.pgn` That way, you could add further selection criteria to the first pass if required.  
  
  ---
  
  ## 0 answers
  
  