Please give me the tool which can deleting moves in pgn database.
I want delete moves after move 22nd or 35th in every game from database
Chess Tools
Moderators: hgm, Rebel, chrisw
-
- Posts: 4607
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: Chess Tools
Use pgn extract.main line wrote:Please give me the tool which can deleting moves in pgn database.
I want delete moves after move 22nd or 35th in every game from database
https://rwbc-chess.de
trollwatch:
Talkchess nowadays is a joke - it is full of trolls/idiots/people stuck in the pleistocene > 80% of the posts fall into this category...
trollwatch:
Talkchess nowadays is a joke - it is full of trolls/idiots/people stuck in the pleistocene > 80% of the posts fall into this category...
-
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Chess Tools
Delete after 22nd move.main line wrote:Please give me the tool which can deleting moves in pgn database.
I want delete moves after move 22nd or 35th in every game from database
Code: Select all
pgn-extract.exe --plylimit 44 --output out_22_mygames.pgn mygames.pgn
Code: Select all
pgn-extract.exe --plylimit 70 --output out_35_mygames.pgn mygames.pgn
Download pgn-extract.exe at:
https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/
Sample output of 22nd move, be aware of Result 0-1 and the * at the end of moves, they are not consistent, but it cuts the moves well.
Code: Select all
[Event "?"]
[Site "?"]
[Date "2010.07.28"]
[Round "?"]
[White "www"]
[Black "bbb"]
[Result "0-1"]
[ECO "B18"]
1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 h6 7. h5 Bh7 8.
Bd3 Bxd3 9. Qxd3 Nf6 10. Nf3 e6 11. c4 Bb4+ 12. Bd2 a5 13. Bc3 Nbd7 14. Rd1
O-O 15. O-O Qc7 16. Rfe1 Rfd8 17. Qe2 Qf4 18. Ne5 Nxe5 19. dxe5 Ng4 20.
Rxd8+ Rxd8 21. Qf3 Qg5 22. Re4 Bxc3 *
-
- Posts: 1056
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
Re: Chess Tools
Using "truncate" from 40H-PGN tools in a command window:main line wrote:Please give me the tool which can deleting moves in pgn database.
I want delete moves after move 22nd or 35th in every game from database
truncate alpha.pgn 44
truncate alpha.pgn 70
use 44 because 22 moves translates to 44 plies, similar for 35 and 70
output is put into a temporary file "outU.pgn" which you will rename
download from
http://komodochess.com/pub/40H-pgn-utilities/
-
- Posts: 1010
- Joined: Thu Sep 01, 2011 2:49 pm
Re: Chess Tools
You mean an output that's something like:Nordlandia wrote:It's vital to include base time as well. For example "[TimeControl "300+5"]" in the pgn header. And add that time in the calculation too.MikeGL wrote:I think this is an easy one even for a newbie/hobbyist programmer like me, as long as the format of clock contains a suffix 's' just like the below sample
PGN, all the program needs to do is collect all those numbers then add them up.
Code: Select all
[TimeControl "300+5"] 9777 9788 19,565
Total Time used by White: 9777s
Total Time used by Black: 9788s
Total for this game: 19,565s
or in HH:MM:SS format?
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.
-
- Posts: 2821
- Joined: Fri Sep 25, 2015 9:38 pm
- Location: Sortland, Norway
Re: Chess Tools
Mike: i prefer HH:MM:SS format
-
- Posts: 1010
- Joined: Thu Sep 01, 2011 2:49 pm
Re: Chess Tools
Would try and then post around this Sunday (Easter) or on Monday.Nordlandia wrote:Mike: i prefer HH:MM:SS format
Time and skill constraints
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.
-
- Posts: 60
- Joined: Thu Jul 07, 2016 10:15 pm
Re: Chess Tools
Yes my file is "mygames.pgn", but what is the folder name where I need put this file "mygames.pgn" ?
-
- Posts: 60
- Joined: Thu Jul 07, 2016 10:15 pm
Re: Chess Tools
I downloaded it but when I press double click on trunkate.exe "command prompt" appears 0.1 second and gone and I can't put yours commands.
What is my mistake ? What do I do wrong?
Can you please tell me where I need put my file - games.pgn? in Document folder or in same folder where trunkate.exe is or maybe C:\Users\"My name" folder?
What is my mistake ? What do I do wrong?
Can you please tell me where I need put my file - games.pgn? in Document folder or in same folder where trunkate.exe is or maybe C:\Users\"My name" folder?
-
- Posts: 1056
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
Re: Chess Tools
1. unzip the download "40H-PGN-xxxxxxxx".main line wrote:I downloaded it but when I press double click on trunkate.exe "command prompt" appears 0.1 second and gone and I can't put yours commands.
What is my mistake ? What do I do wrong?
Can you please tell me where I need put my file - games.pgn? in Document folder or in same folder where trunkate.exe is or maybe C:\Users"My name" folder?
2. in command window, go to the folder where truncate.exe is located.
3. in command window, copy "truncate.exe" to folder where you have pgn file games.pgn
(or if you prefer, copy games.pgn to folder where truncate.exe is located)
3. in the command window, execute the command
truncate games.pgn
truncate.exe works only in a command window. clicking, or double-clicking, on its icon in windows explorer will not get it to work. you have to enter a command in the command window.