lichess.org
Donate

Downloading study PGN without evaluations

When you open a chapter of a study, in the share tab you have the option of copying or downloading the PGN. Is it possible to download the raw PGN without any engine evaluations?

I've seen that through the API there is an option of downloading the PGN without comments, but that seems to still keep the evaluations.

Thanks in advance for the help!
Hmmm... seems indeed broken.

You can download the PGN as is and then remove evaluations with sed or sd (github.com/chmln/sd), e.g. this should work:

sd '\[%eval [#-.0-9]*\] ' '' study.pgn
sed -i -e 's/\[%eval [#-.0-9]*\] //g' study.pgn

The file would be modified in-place. You may drop "-i" for sed and I think add "-p" for sd if you don't want this and want to redirect output to another file, i.e.

sd -p '\[%eval [#-.0-9]*\] ' '' study.pgn > fixed.pgn
sed -e 's/\[%eval [#-.0-9]*\] //g' study.pgn > fixed.pgn

If you want to drop every comment in there, evals, clock times, the easiest is just to use pgn-extract (www.cs.kent.ac.uk/people/staff/djb/pgn-extract/):

pgn-extract -s -C -o fixed.png study.pgn

-N drops NAGs, i.e. ?, !, !? and so on.
-V drops variations
See www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html for a full description.
Much easier to "clean" a PGN is to paste it in the Analysis Board. The resulting PGN has only the moves
<Comment deleted by user>
I hope so, because copy/pasting thousands of games wouldn't be easy hehe.
I would still use pgn-extract, it check validity of the file, results, missing mandatory tags and so on. You would basically get a reliable PGN that should work across the programs.

This topic has been archived and can no longer be replied to.