Life In 19x19
http://www.lifein19x19.com/

Batch-editing game details on SGF files
http://www.lifein19x19.com/viewtopic.php?f=18&t=11012
Page 1 of 1

Author:  PeterPeter [ Sun Nov 02, 2014 9:17 am ]
Post subject:  Batch-editing game details on SGF files

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.

Author:  xed_over [ Mon Nov 03, 2014 1:39 am ]
Post subject:  Re: Batch-editing game details on SGF files

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.

Author:  ez4u [ Mon Nov 03, 2014 7:15 am ]
Post subject:  Re: Batch-editing game details on SGF files

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.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/