It is currently Sun May 04, 2025 10:45 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
Offline
 Post subject: smart way to batch make a lot of sgf files anonymous?
Post #1 Posted: Wed Sep 21, 2016 11:36 pm 
Dies with sente
User avatar

Posts: 74
Location: Germany
Liked others: 141
Was liked: 19
Rank: kgs 5 kyu
Universal go server handle: eyecatcher
I love to replay pro-games, and to read personal stories about pro players... some pro players i like more than others, for example my most favorite players are: Go Seigen and Seo Pong-su, maybe as well Sakata Eio.
But actually i think i don`t really like them because of their style, or only based on what i read about their style, not what i really saw in their games.

The story goes like this:

I want to make a lot of sgf files from my (gogood / go4go) database anonymous and than replay games and rate them ... in the end, after a few weeks i want to (with the fuseki search of smartgo) look by whom the games where really played and see who`s games i really liked most ... only based on the games, not distracted by any personal emotions or Sympathie.

The question is here:
is here anyone who can tell me if there is a smart way, to delete the players info in sgf files automated? without opening one after the other with a texteditior or smartgo windows?

_________________
“Play where you want and don’t be afraid. If you’re chasing the dream you must take the risk.” Yasumasa Hane 9p

Top
 Profile  
 
Offline
 Post subject: Re: smart way to batch make a lot of sgf files anonymous?
Post #2 Posted: Thu Sep 22, 2016 12:25 am 
Dies with sente
User avatar

Posts: 74
Location: Germany
Liked others: 141
Was liked: 19
Rank: kgs 5 kyu
Universal go server handle: eyecatcher
Ohh, actually there is a quite ok way to do it in smartgo windows (not mac) without any other software... i did not knew that you can edit more player info than only one... normally i use the mac version, so i forgot how powerful the windows version is.

_________________
“Play where you want and don’t be afraid. If you’re chasing the dream you must take the risk.” Yasumasa Hane 9p

Top
 Profile  
 
Offline
 Post subject: Re: smart way to batch make a lot of sgf files anonymous?
Post #3 Posted: Thu Sep 22, 2016 1:56 am 
Lives in sente

Posts: 928
Location: UK
Liked others: 72
Was liked: 480
Rank: 5 dan
KGS: macelee
If you can compile 'sgfutils' on your system, you can achieve what you want by looping through your SGF files and do:

./sgfstrip -t PB -t PW xxx.sgf


This post by macelee was liked by: eyecatcher
Top
 Profile  
 
Offline
 Post subject: Re: smart way to batch make a lot of sgf files anonymous?
Post #4 Posted: Thu Sep 22, 2016 2:03 am 
Dies with sente

Posts: 122
Liked others: 20
Was liked: 13
Rank: 12kyu
On a Mac or other unix you could use sed :

Code:
sed -i .original 's/\(P[WB]\)\[[^]]*]/\1[]/g' *.sgf


This post by mongus was liked by 2 people: eyecatcher, gamesorry
Top
 Profile  
 
Offline
 Post subject: Re: smart way to batch make a lot of sgf files anonymous?
Post #5 Posted: Thu Sep 22, 2016 5:55 am 
Lives in sente

Posts: 1045
Liked others: 0
Was liked: 182
The question is here:
is here anyone who can tell me if there is a smart way, to delete the players info in sgf files automated? without opening one after the other with a texteditior or smartgo windows?

"Translation" of some of your answers:

Instead of manually opening one at a time and editing manually one at a time you could use a BATCH PROCESS. A "script" selecting the files to be edited and feeding them to a batch editor. You might not have these tools available on your computer, but as they point out, any 'nix OS would with its "shell language" and the standard utility library.

Obviously some learning involved if you have never done this sort of thing before. So the answer to your question (literal answer) is yes, there is such a way, but whether that is useful to you would depend on getting a 'nix OS installed and learning how to use the shell language and utilities.

Of course also possible without the 'nix tools if you have ANY programming language available on your computer and know how to code in it. But that is even more learning/work.

PS: Obviously also true -- some of us here might simply give you the necessary script and utility control which you could then just run. As pointed out, besides the more obvious 'nix OS's, the Macs are actually running a 'nix under the hood (I think a form of BSD) which you could access at the command line << though I know of few Mac users who ever use the command line >>


This post by Mike Novack was liked by: eyecatcher
Top
 Profile  
 
Offline
 Post subject: Re: smart way to batch make a lot of sgf files anonymous?
Post #6 Posted: Thu Sep 22, 2016 6:16 am 
Judan

Posts: 6727
Location: Cambridge, UK
Liked others: 436
Was liked: 3720
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
mongus wrote:
On a Mac or other unix you could use sed :

Code:
sed -i .original 's/\(P[WB]\)\[[^]]*]/\1[]/g' *.sgf


Fun fact of the day: sed was written Lee McMahon, whose surname is probably well known to Go players for the McMahon pairing system used in many amateur Go tournaments (though his system was originally for a club ladder and then used as a tournament system by Brits).


This post by Uberdude was liked by 3 people: eyecatcher, fireproof, gamesorry
Top
 Profile  
 
Offline
 Post subject: Re: smart way to batch make a lot of sgf files anonymous?
Post #7 Posted: Thu Sep 22, 2016 3:30 pm 
Dies with sente
User avatar

Posts: 74
Location: Germany
Liked others: 141
Was liked: 19
Rank: kgs 5 kyu
Universal go server handle: eyecatcher
Mike Novack wrote:
Obviously some learning involved if you have never done this sort of thing before.


apart from having some html basic back in high school and some very very "google and copy paste" programming for my self hosted wordpress...

no, i know what you are talking about, but it is too complicated for me to get into this kind of script thing.

I found a way in smartgo anyway, i thought i could not be done in smartgo, but it is working.

Thank you all.

_________________
“Play where you want and don’t be afraid. If you’re chasing the dream you must take the risk.” Yasumasa Hane 9p

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group