modify pgn notation

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Jonathan003
Posts: 243
Joined: Fri Jul 06, 2018 4:23 pm
Full name: Jonathan Cremers

modify pgn notation

Post by Jonathan003 »

Anyone knows how I can modify a big pgn file with notations like this

Code: Select all

[Event "Chess Position Trainer"]
[Site "Chess Position Trainer"]
[Date "????.??.??"]
[Round "?"]
[White "Harry"]
[Black "Jonathan"]
[Result "*"]

1.d4 {!} 1...Nf6 2.c4 {!!} 2...e6 3.Nf3 {!!} 3...b6 *
So it looks like this

Code: Select all

[Event "Chess Position Trainer"]
[Site "Chess Position Trainer"]
[Date "????.??.??"]
[Round "?"]
[White "Harry"]
[Black "Jonathan"]
[Result "*"]

1.d4! Nf6 2.c4!! 2.e6 3.Nf3!! b6 *
fsanders
Posts: 17
Joined: Wed Jan 18, 2023 10:53 pm
Full name: Frank Sanders

Re: modify pgn notation

Post by fsanders »

I think even Word with the replace function can do this.
Branko Radovanovic
Posts: 89
Joined: Sat Sep 13, 2014 4:12 pm
Location: Zagreb, Croatia
Full name: Branko Radovanović

Re: modify pgn notation

Post by Branko Radovanovic »

You can do it in Notepad++. Use the find/replace function, select the Regular expression search mode, and replace:

Code: Select all

 {(.*?)}
(note leading whitespace)

...with:

Code: Select all

\1
Jonathan003
Posts: 243
Joined: Fri Jul 06, 2018 4:23 pm
Full name: Jonathan Cremers

Re: modify pgn notation

Post by Jonathan003 »

Thanks for the suggestions. I find an easier way by importing and exporting in SCID