I will try to explain what I want here:
-this is command I got from somebody in TCEC chat :
perl -00 -ne "s/([ \t\n\r][0-9]+[.][ \t\n\r])/!$1/g;print;" games.pgn>blackwon.pgn
(this command working in Perl's command prompt)
I am using it to make all black moves "!"-signed in the database finished 0-1. Similar command is signing all white moves "!" in database contains games finished 1-0.
Similar command is this:
perl -00 -ne "s/([ \t\n\r][0-9]+[.][ \t\n\r])/?$1/g;print;" games.pgn>blacklost.pgn
this signed all black moves "?" in every game in the whole database contains games finished 1-0.
And these commands are perfectly working with sign !!
, !?
, ?!
and ??
too (only need to put them in the command line instead existing !
or ?
sign).
I am using these "signed games" for make ctg.book
.
But I tried ( unsuccessfully ) to get commands to put this sign ($18
) or combination ($144 $40
for ex.) on the right place in the pgn.file
. It is not same as commands about !
,?
signs because ($18
) comes after extra space ahead move (white or black). Another problem is that $
is not simple letter/sign in Perl ( but a dollar sign ($
) has some function).
Here is example what signs exist -
$18
$19
$16
$17
$14
$15
$11
$13
$36
$44
$32
Or a combination:
$144 $40
Like in the next game:
1. e4 $18 c6 $19 2. d4 $16 d5 $17 3. e5 $14 Bf5 $15 4. Nf3 $11 e6 $13 5. Be2 $36 Nd7 $44 6. O-O $144 $40 Ne7 $32 *
And what we can to do about that? Can somebody very smart to make program to put this "sign" $18
in pgn games of whole database after every white move or after every black move or in same time after every white and black move?
Here is example game where did import sign $14
after every white move (but notice that after white move and sign $14
have space):
[Event "?"]
[Site "?"]
[Date "2018.04.11"]
[Round "?"]
[White "Bond"]
[Black "Tor"]
[Result "1/2-1/2"]
[ECO "C88"]
[Annotator "Top"]
[PlyCount "26"]
[SourceDate "2018.04.11"]
[SourceVersionDate "2018.04.11"]
1. e4 $14 e5 2. Nf3 $14 Nc6 3. Bb5 $14 a6
4. Ba4 $14 Nf6 5. O-O $14 Be7 6. Re1 $14 b5
7. Bb3 $14 O-O 8. h3 $14 Bb7 9. d3 $14 d6
10. a3 $14 Nb8 11. Nbd2 $14 Nbd7 12. Nf1 $14 Re8
13. Ng3 $14 Bf8 1/2-1/2