Swap colors in sgf

For discussing go computing, software announcements, etc.
Post Reply
anpd
Dies in gote
Posts: 42
Joined: Wed Jan 22, 2014 3:34 am
Rank: KGS 10 kyu
GD Posts: 0
KGS: anpd
Has thanked: 17 times
Been thanked: 9 times

Swap colors in sgf

Post by anpd »

Hi anyone know of an easy way to swap colors of a sgf file? It's for tsumego files.
Kap
Beginner
Posts: 12
Joined: Sun Apr 10, 2016 8:39 am
Rank: SDK
GD Posts: 0
Has thanked: 14 times
Been thanked: 6 times

Re: Swap colors in sgf

Post by Kap »

Drago has a feature to swap colors.

Just load the position, click View -> Swap colors and save it.
anpd
Dies in gote
Posts: 42
Joined: Wed Jan 22, 2014 3:34 am
Rank: KGS 10 kyu
GD Posts: 0
KGS: anpd
Has thanked: 17 times
Been thanked: 9 times

Re: Swap colors in sgf

Post by anpd »

I tried Drago, it swaps the colors and the tree looks correct. But when saving it's the original file without the color swap, am I missing a step?
Kap
Beginner
Posts: 12
Joined: Sun Apr 10, 2016 8:39 am
Rank: SDK
GD Posts: 0
Has thanked: 14 times
Been thanked: 6 times

Re: Swap colors in sgf

Post by Kap »

Well, that's a tad embarrassing :-? I simply assumed Drago would save the changes, but it appears to only be visual.

In that case I'm unfortunately not aware of any software that does what you want.


If worse comes to worst you can always use a text editor with a find-and-replace tool (ctrl + h in the default Microsoft Notepad) to swap the colors of the stones. Since you can replace all occurances of a given string at once this way it's at least better than doing it all by hand...

To swap all pre-placed stones, first replace "AW[" with "PLACEHOLDER", followed by replacing "AB[" with "AW[" and lastly "PLACEHOLDER" with "AB[".

For the solutions, find and replace ";W[" with "PLACEHOLDER", followed by ";B[" with ";W[" and finally "PLACEHOLDER" with ";B[".
zorq
Beginner
Posts: 15
Joined: Mon Nov 25, 2013 8:26 pm
GD Posts: 0
Been thanked: 3 times

Re: Swap colors in sgf

Post by zorq »

anpd wrote:Hi anyone know of an easy way to swap colors of a sgf file? It's for tsumego files.
Try sgftf.
anpd
Dies in gote
Posts: 42
Joined: Wed Jan 22, 2014 3:34 am
Rank: KGS 10 kyu
GD Posts: 0
KGS: anpd
Has thanked: 17 times
Been thanked: 9 times

Re: Swap colors in sgf

Post by anpd »

zorq wrote:
anpd wrote:Hi anyone know of an easy way to swap colors of a sgf file? It's for tsumego files.
Try sgftf.
Thanks, looks like that will work :)
anpd
Dies in gote
Posts: 42
Joined: Wed Jan 22, 2014 3:34 am
Rank: KGS 10 kyu
GD Posts: 0
KGS: anpd
Has thanked: 17 times
Been thanked: 9 times

Re: Swap colors in sgf

Post by anpd »

Kap wrote:Well, that's a tad embarrassing :-? I simply assumed Drago would save the changes, but it appears to only be visual.

In that case I'm unfortunately not aware of any software that does what you want.


If worse comes to worst you can always use a text editor with a find-and-replace tool (ctrl + h in the default Microsoft Notepad) to swap the colors of the stones. Since you can replace all occurances of a given string at once this way it's at least better than doing it all by hand...

To swap all pre-placed stones, first replace "AW[" with "PLACEHOLDER", followed by replacing "AB[" with "AW[" and lastly "PLACEHOLDER" with "AB[".

For the solutions, find and replace ";W[" with "PLACEHOLDER", followed by ";B[" with ";W[" and finally "PLACEHOLDER" with ";B[".
Yes was hoping to avoid that, will try zorq's suggestion. Otherwise I will have to do that.
Post Reply