For a moment there, you gave me a scare. I used that exact syntax a couple of weeks ago (would've hated a need to retrace my steps). BTW, I noticed you modified gameSplit, and it can now create more than 20 files, that allows me to finally check the PGN file, without having to run that tool… twice.Norm Pollock wrote:Ooops!!! You are correct. My bad. The current version replaces tag values with a default value, ONE TAG TYPE AT A TIME. Please ignore my previous comments about tagNull. However my comment about "truncate" was correct.Ozymandias wrote:You mean that if I write "tagNull alpha.pgn Round", is not just the "Round" tag that gets modified? I seem to recall it was.Norm Pollock wrote:I'm thinking about modifying "tagNull" to replace tag values with a null value one tag type at a time. Perhaps the current way of replacing ALL tag values with a null value in one shot is too extreme.
Therefore, Carlos should NOT replace tag values with defaults for ECO and Result.
Tool for truncate pgn files
Moderator: Ras
-
Ozymandias
- Posts: 1537
- Joined: Sun Oct 25, 2009 2:30 am
Re: Tool for truncate PGN files.
-
Norm Pollock
- Posts: 1087
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
Re: Tool for truncate PGN files.
You should have contacted me, pm or email, if you think there is a way to make a tool easier to use.Ozymandias wrote:For a moment there, you gave me a scare. I used that exact syntax a couple of weeks ago (would've hated a need to retrace my steps). BTW, I noticed you modified gameSplit, and it can now create more than 20 files, that allows me to finally check the PGN file, without having to run that tool… twice.Norm Pollock wrote:Ooops!!! You are correct. My bad. The current version replaces tag values with a default value, ONE TAG TYPE AT A TIME. Please ignore my previous comments about tagNull. However my comment about "truncate" was correct.Ozymandias wrote:You mean that if I write "tagNull alpha.pgn Round", is not just the "Round" tag that gets modified? I seem to recall it was.Norm Pollock wrote:I'm thinking about modifying "tagNull" to replace tag values with a null value one tag type at a time. Perhaps the current way of replacing ALL tag values with a null value in one shot is too extreme.
Therefore, Carlos should NOT replace tag values with defaults for ECO and Result.
-
Ozymandias
- Posts: 1537
- Joined: Sun Oct 25, 2009 2:30 am
Re: Tool for truncate PGN files.
Ok, did that.
-
Elorejano
- Posts: 167
- Joined: Sat Mar 20, 2010 3:31 am
Re: Tool for truncate PGN files.
so, with your util, i must aply one by one?
Thanks
Thanks
-
Norm Pollock
- Posts: 1087
- Joined: Thu Mar 09, 2006 4:15 pm
- Location: Long Island, NY, USA
Re: Tool for truncate PGN files.
Yes. And you have to rename the output as you go step by step. Here is an example:Elorejano wrote:so, with your util, i must aply one by one?
Thanks
Code: Select all
tagNull alpha.pgn Event
ren outH.pgn temp.pgn
tagNull temp.pgn Site
ren outH.pgn temp.pgn
tagNull temp.pgn Round
The file "outH.pgn" will now have the tag types Event, Site and Round
set to their default values.
-
MikeB
- Posts: 4889
- Joined: Thu Mar 09, 2006 6:34 am
- Location: Pen Argyl, Pennsylvania
Re: Tool for truncate pgn files
Regarding the option --plylimit, it is not a ply limit, but a move limit. For example, say you would want limit the game to 10 moves for each side. That is 20 ply, but when you use "--plylimit 10" - it will limit the game to 20 ply ( 10 moves for each side ). The option is mislabeled, that's all. It does work.
-
MikeB
- Posts: 4889
- Joined: Thu Mar 09, 2006 6:34 am
- Location: Pen Argyl, Pennsylvania
Re: Tool for truncate pgn files
There is a little trick to get then back.Elorejano wrote:Hi!
Truncate works fine but i couldnt change the tags.
With
--notags
tags disapears and i need them
Any help?
Thanks in advance
Say you run this:
Code: Select all
./pgn-extract --notags -nags all16.pgn -o notag2.pgnCode: Select all
1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 e6 5. Nc3 Nf6 6. Ndb5 d6 7. Bf4 e5
8. Bg5 a6 *
1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 O-O 5. a3 Bxc3+ 6. Qxc3 b6 7. Bg5 Bb7
8. f3 h6 *
etc
1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nb5 d6 6. c4 Nf6 7. N1c3 a6 8.
Na3 Be7 *Code: Select all
./pgn-extract --plylimit 300 notag2.pgn -o addtags.pgnCode: Select all
[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 e6 5. Nc3 Nf6 6. Ndb5 d6 7. Bf4 e5
8. Bg5 a6 *
[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 O-O 5. a3 Bxc3+ 6. Qxc3 b6 7. Bg5 Bb7
8. f3 h6 *
[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nb5 d6 6. c4 Nf6 7. N1c3 a6 8.
Na3 Be7 *-
Elorejano
- Posts: 167
- Joined: Sat Mar 20, 2010 3:31 am
Re: Tool for truncate pgn files
Hi! All works.
But its imposible for programersfriends make a bat file for to make this process in one time? Sory, im not a programer
Cheers
But its imposible for programersfriends make a bat file for to make this process in one time? Sory, im not a programer
Cheers