I have succeeded in several operations of text files with guidance of you friends. Firstly thank you very much for helping me with commands.
Now, I wish to move further in these operations on text file and one of the places I get stuck is I wish I could remove the *
at the end of last line (of every text file within same directory) with either 1/2-1/2
or 1-0
or 0-1
This is the text file content:
- Nh3 d5 2. g3 e5 3. f4 Bxh3 4. Bxh3 exf4*
And 1/2-1/2 would represent a draw which would look like this:
- Nh3 d5 2. g3 e5 3. f4 Bxh3 4. Bxh3 exf4 1/2-1/2
1-0 means White won and it would be like this:
- Nh3 d5 2. g3 e5 3. f4 Bxh3 4. Bxh3 exf4 1-0
0-1 would mean Black won and would be like this:
- Nh3 d5 2. g3 e5 3. f4 Bxh3 4. Bxh3 exf4 0-1
Please ignore the * in the title, i only wish to change the content of the text file.
This I wish to do is because by keeping it from any of 1/2-1/2
or 1-0
or 0-1
I will be able to make the chess engine believe that the game was drawn or lost or won by which side. This would be very useful. I thank you very much for helping me. Thanks a lot.
Edit: There are 2000+ files. The reason why I wish to do this is because to find novelties and new lines (never played before) in lesser played variants of the game. This is what I wish to achieve by this operation.
*
with.