Lyudmil Tsvetkov wrote:Anyone knowing of a trick to strip the pgn to just the moves played for both sides?
Even better, if this could be done with the whole pgn file.
pgn-extract v16.7 (Jul 18 2008): a Portable Game Notation (PGN) manipulator.
Copyright (C) 1994-2007 David J. Barnes (d.j.barnes@kent.ac.uk)
http://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/
And to clean a PGN file, one needs to redirect the output to something using
the DOS redirection >> operator like so:
Note that the input pgn doesn't have a prefixed (hyphen or dash -),
I think that's why there's error about - in OP's attempt.
Edit: sorry, you are also correct. the -o switch dictates the output file.
Also, I think I figured out how he got the error, he types pgn-extract first (which triggers INTERACTIVE mode)
and then paste another pgn-extract -s -C -N -V command while inside the program.
It shoud be pasted directly in command prompt just ONCE, not twice.
I told my wife that a husband is like a fine wine; he gets better with age. The next day, she locked me in the cellar.
I still use the original Scid database program by Shane Hudson, v3.5 in linux, and v3.6.1 in Windows
Open the pgn file and then select Tools >> Export All Filter Games >> Export Filter to PGN File...
The following dialog window appears, where you can select what items of the pgn file you want to export to a new pgn file.
Shredder can export clean pgn's too. Trial versions could do it. Only the game that is loaded in the GUI I think, not whole tournament files. It sometimes has trouble though with Chessbase pgn's with very convoluted variations. But probably Lyudmil has some obscure old Arena version from the 90's It woud have helped if you said what GUI you are using Lyudmil. Can't Arena do this?
(If I can't get Shredder to work, I would try the excellent capabilities of SCID indeed. I have HIARCS, a Chessbase version on an old computer if necessary. The free Chessbase readers I don't know if they can strip pgn, probably not)
Last edited by Eelco de Groot on Fri Feb 16, 2018 6:57 pm, edited 1 time in total.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
Lyudmil Tsvetkov wrote:Where should the pgn extract exe be placed, in the same folder with the files?
When I tried above command, I get the following:
Processing stdin
pgn-extract -s -C -N -V -oclean.pgn TCEC_Season_5
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
File stdin: Line number: 1
Unknown move text pgn.
File stdin: Line number: 1
Unknown move text T.
File stdin: Line number: 1
Unknown character C (Hex: 43).
Missing result.
Any clue what is going wrong?
The pgn file should be in the pgn-extract extract folder, for simplicity (I haven't even tried to redirect to another folder). As you suspect, oclean.pgn and input.pgn are the destination and source files, you can obviously change them, just don't use special characters (TCECSeason5, for example, should be fine).
Many thanks.
It still says: Single '-' not allowed.
What could that possibly mean?
'-' is just the dash, right, not an underscore?
No, it's not. I thought that could be it, but then I performed a zoom and saw that wasn't the case. You're writing "TCEC_Season_5.pgn", right? Because I don't see the extension in your post.
No, I am doing everything just as the documentation says to do it, but it still does not work.
Nothing works for me around this time of year.
What could single dash not allowed mean?
Anyone tried to strip TCEC pgns, maybe there is something wrong with them?
Anywhere one can download stripped TCEC pgns?
- I think is not a dash but a hyphen see http://www.sussex.ac.uk/informatics/pun ... ddash/dash Have you tried Mike Libanan's advice? I'm not a hero with commandline and can't ever remember those commands so I have to resort to looking it up and paste the whole thing. Then I press "Enter"
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
MikeGL wrote:I think I figured out how he got the error, he types pgn-extract first (which triggers INTERACTIVE mode)
and then paste another pgn-extract -s -C -N -V command while inside the program.
It should be pasted directly in command prompt just ONCE, not twice.
Confirmed, I tried that and got the following:
C:\40H\pgn-extract>pgn-extract
Processing stdin
pgn-extract -s -C -N -V -oclean.pgn TCEC_Season_5.pgn
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
File stdin: Line number: 1
Unknown move text pgn.
File stdin: Line number: 1
Unknown move text T.
File stdin: Line number: 1
Unknown character C (Hex: 43).
Missing result.
Lyudmil Tsvetkov wrote:What could single dash not allowed mean?
Anyone tried to strip TCEC pgns, maybe there is something wrong with them?
Anywhere one can download stripped TCEC pgns?
There's nothing wrong with them, I cleaned that file at the first go with the line we've been talking about, the difficult thing was to figure out how you got that error message; just do what Mike Libanan says and you're good to go.
Lyudmil Tsvetkov wrote:Where should the pgn extract exe be placed, in the same folder with the files?
When I tried above command, I get the following:
Processing stdin
pgn-extract -s -C -N -V -oclean.pgn TCEC_Season_5
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
Single '-' not allowed.
File stdin: Line number: 1
File stdin: Line number: 1
Unknown move text pgn.
File stdin: Line number: 1
Unknown move text T.
File stdin: Line number: 1
Unknown character C (Hex: 43).
Missing result.
Any clue what is going wrong?
The pgn file should be in the pgn-extract extract folder, for simplicity (I haven't even tried to redirect to another folder). As you suspect, oclean.pgn and input.pgn are the destination and source files, you can obviously change them, just don't use special characters (TCECSeason5, for example, should be fine).
Many thanks.
It still says: Single '-' not allowed.
What could that possibly mean?
'-' is just the dash, right, not an underscore?
In case you missed the post above, here it is again -- the simplest way. Norm has more than 50 command-line PGN tools like this for virtually any case in life: http://komodochess.com/pub/40H-pgn-utilities.
In Fritz GUIs you can do it, too, but only one game at a time. Load a game, right click anywhere in the notation pane and pick "Delete All Commentary" (or do Ctrl+F2).
Lastly, there's a GUI for PGN-Extract (PGN-Extract Interface by Ferdinand Mosca) if you're not handy with the command line.
Thank you everybody for the suggestions.
I guess I am just in a hurry and missing something, mistyping something or the like.
It finally worked with Ferdie's tool and the very precious Tim's advice.
I love those guys.
Lyudmil Tsvetkov wrote:
Anyone knowing of a trick to strip the pgn to just the moves played for both sides?
Even better, if this could be done with the whole pgn file.
Or, alternatively, does anyone know if there are stripped TCEC pgn files for download somewhere?
Thanks, hope someone helps.
Using Scid vs PC allows strip comments of single games via Edit->Strip->Comments
The maintenance window will strip all games comments, but is very slow.
In subversion/the windows betas, it has been sped up a bit, ~ 10x.