Looking for a PGN utility to remove chess960/frc games

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Dann Corbit
Posts: 10856
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Looking for a PGN utility to remove chess960/frc games

Post by Dann Corbit » Mon Mar 23, 2020 1:08 am

I am looking for a tool (already written) that will remove all the FRC/Chess960 games from a PGN file.
Does such a thing exist?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Norm Pollock
Posts: 1024
Joined: Thu Mar 09, 2006 3:15 pm
Location: Long Island, NY, USA
Contact:

Re: Looking for a PGN utility to remove chess960/frc games

Post by Norm Pollock » Mon Mar 23, 2020 1:15 am

The tool "fenRemove" in 40H-PGN tool box

http://komodochess.com/pub/40H-pgn-utilities/

Here is the readme:

Code: Select all

=========================(18) fenRemove ============================

"fenRemove" removes games containing a "FEN" tag except when the 
"FEN" position is the standard opening position.

The output file is "out6.pgn". Removed games are in "exclude6.pgn".

The "FEN" of the standard opening position:

  rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

Use "tagFix" to remove "FEN" & "SetUp" tags for the standard opening
position.

Syntax:   fenRemove filename.pgn 

Example:  fenRemove alpha.pgn

Output:   out6.pgn, exclude6.pgn

Comments:

     1. "fenRemove" removes almost all "Chess960" ("Fischer Random 
        Chess") games. The only games it does not remove are the
        games where the "FEN" position is the standard opening 
        position, a 1 out of 960 possibility.
It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change. -- Charles Darwin

Dann Corbit
Posts: 10856
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Looking for a PGN utility to remove chess960/frc games

Post by Dann Corbit » Mon Mar 23, 2020 3:21 am

Sir,
If you have not been nominated for Knighthood, that is a dreadful oversight.
I believe that the name Norman itself has Heraldic roots.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

User avatar
Deberger
Posts: 45
Joined: Sat Nov 02, 2019 5:42 pm
Full name: ɹǝƃɹǝqǝᗡ ǝɔnɹꓭ

Re: Looking for a PGN utility to remove chess960/frc games

Post by Deberger » Mon Mar 23, 2020 6:18 am

pgn-extract seems most logical.

Extract games which match the start position and do not have the Variant tag.

User avatar
Ozymandias
Posts: 1177
Joined: Sun Oct 25, 2009 12:30 am

Re: Looking for a PGN utility to remove chess960/frc games

Post by Ozymandias » Mon Mar 23, 2020 8:47 am

You don't even need the Variant tag:

Code: Select all

pgn-extract -s -C -N -V -tstartpos.txt -oclean.pgn database.pgn
where startpos.txt is:

Code: Select all

FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
I prefer this over fenRemove, because oftentimes, I first need to clean the DB anyway and pgn-extract takes care of both tasks, in one go.

Jonathan003
Posts: 114
Joined: Fri Jul 06, 2018 2:23 pm
Full name: Jonathan Cremers

Re: Looking for a PGN utility to remove chess960/frc games

Post by Jonathan003 » Tue Apr 14, 2020 9:08 pm

You can also do it with SCID. You first have to make a new database in SCID format and inport the pgn database, than when finished you can export the database to a pgn database. Scid 4.7 is very fast and can handle very big databases. I use the windows version but there is also a linux version.

Here is a interesting video tutorial that describe how to do it in Scid Vs PC, but you can do the same with Scid 4.7

It's described at minute 22

https://youtu.be/Zwy-pE54V9w?t=1320

Post Reply