It is currently Sun May 11, 2025 2:17 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
Offline
 Post subject: Batch-editing game details on SGF files
Post #1 Posted: Sun Nov 02, 2014 9:17 am 
Lives with ko
User avatar

Posts: 285
Location: UK
Liked others: 42
Was liked: 52
I have dozens of my games saved on my computer, all as individual SGF files. To make this growing collection easier to manage, I want to use a database. I use Drago for most reviewing and editing, and that has a database option, so that was my first place to look.

The problem is that the information for each game (date, black player, white player, venue etc; would you call them "tags"?) is recorded differently by different playing sites and programs, so there is no consistency and lots of gaps.

Can anyone recommend a program that I could use to sort out these tags in batch? For example, Igo for Windows always labels me as "Human". I would like to highlight say 50 of those games, then in one operation, change all those tags to my real name.

_________________
Regards,

Peter

Top
 Profile  
 
Offline
 Post subject: Re: Batch-editing game details on SGF files
Post #2 Posted: Mon Nov 03, 2014 1:39 am 
Oza

Posts: 2264
Liked others: 1180
Was liked: 553
sgf files are just plain text files, easily edited with any plain text editor.
there are a myriad of tools that can do simple search and replace of the text strings inside those files.
the simplest off the top of my head would be sed or perl or many other scripting languages.

Top
 Profile  
 
Offline
 Post subject: Re: Batch-editing game details on SGF files
Post #3 Posted: Mon Nov 03, 2014 7:15 am 
Oza
User avatar

Posts: 2414
Location: Tokyo, Japan
Liked others: 2351
Was liked: 1332
Rank: Jp 6 dan
KGS: ez4u
If you are not the type of person that wants to learn perl in order to change a few lines of text, you can search the web with something like "windows text search and replace" or "windows grep equivalent" and find many gui-based programs for free. If you quite literally want to pick 11 *.sgf files out of a directory of 100 using your mouse (just like in windows explorer) and then search for "PB[human]" and replace it with "PB[that twit ez4u]" then you might like textrep, which seems to do exactly that. More commonly these programs will search all the *sgf files in your directory and do the replacement across the lot or via some filters that you specify rather than hand selecting the files. You might like dnGrep in that case. Note that I could search for, check the screenshots, download and install, and then test for myself about four of these programs in about an hour. There are quite a few out there and they're pretty easy to find.

_________________
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21


This post by ez4u was liked by 2 people: Bill Spight, PeterPeter
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [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