Life In 19x19 http://www.lifein19x19.com/ |
|
Merging SGFs http://www.lifein19x19.com/viewtopic.php?f=18&t=5217 |
Page 1 of 1 |
Author: | daal [ Wed Dec 28, 2011 5:23 am ] |
Post subject: | Merging SGFs |
Greetings, How can I merge a fairly large quantity of sgfs (tsumego probs) into one sgf file? The reason I ask, is that I recently tried to view single files of Carl Jung's 440 problems on wegoigo on an android phone, and it didn't work so well, and then I installed the merged files which he had at some point made available, and they worked like a charm, so now I would like to try that with some other files as well. Thanks. |
Author: | Kirby [ Wed Dec 28, 2011 6:25 am ] |
Post subject: | Re: Merging SGFs |
A variation is enclosed in parentheses. After the root with basi info (only have one root), you can see the main variation in parentheses. Subvariations are in subparentheses. To merge another sgf from move 1, just copy that big set of text after the root including parentheses, and paste it after the closing parenthesis of the original file. If this is confusing, this page may clarify: http://www.red-bean.com/sgf/sgf4.html In particular, pretend move A in the first diagram is the first move in your first sgf. Move F can be move 1 from your second sgf. You can see the general pattern that, when a new variation comes up, use parentheses to delimit them. |
Author: | tchan001 [ Wed Dec 28, 2011 6:29 am ] |
Post subject: | Re: Merging SGFs |
Maybe try multigo4 File >> Import Files as Branch |
Author: | CnP [ Wed Dec 28, 2011 7:58 am ] |
Post subject: | Re: Merging SGFs |
I used one of Carl Jung's converters on a set by goplayer2006 on ebay. To combine the sgf files into a single file I found it very easy. I use Ubuntu and I used the 'cat' command to create a single file (actually a number of files one for each difficulty level) that just contained the others. Gogrinder on my android phone took the new file fine. I think weigoigo had problems with it because my phone is cheap and ran out of memory but Gogrinder seems to manage it's memory differently and was okay (these were files with 1000 problems in each). Since they're simple ascii files you can open them up in your favourite text editor anyway. |
Author: | daal [ Wed Dec 28, 2011 9:36 am ] |
Post subject: | Re: Merging SGFs |
@Kirby- since I want to merge hundreds of files, pasting them one by one seems impractical. @TChan - thanks, that was quite easy. Unfortunately, Wegoigo opens the file, but incorrectly - wegoigo does not show the preview, and instead shows a blank board. I don't know if this is because of Wegoigo or Multigo, but CGoban won't open them either, complaining of a "redundant rule specification." @CnP I couldn't find Carl Jung's tool. It doesn't seem to be listed here: viewtopic.php?f=18&t=637&start=0 |
Author: | daal [ Wed Dec 28, 2011 9:42 am ] |
Post subject: | Re: Merging SGFs |
Sensei's library points to this sgf merger: http://www.igoweb.org/~wms/comp/sgfMerger/ but the page blithly says: Quote: To use it, just run the .jar file as a command line application, with the input SGF files as arguments. It will emit merge.sgf. For example, on Unix you would type: $ java -jar sgfMerge.jar x.sgf y.sgf z.sgf On Windows or Mac systems, I'm not sure exactly how to do the same thing, but it should be possible I'm not computer-savvy enough to be able to figure out how to do this. |
Author: | Bill Spight [ Wed Dec 28, 2011 11:10 am ] |
Post subject: | Re: Merging SGFs |
daal wrote: Sensei's library points to this sgf merger: http://www.igoweb.org/~wms/comp/sgfMerger/ but the page blithly says: Quote: To use it, just run the .jar file as a command line application, with the input SGF files as arguments. It will emit merge.sgf. For example, on Unix you would type: $ java -jar sgfMerge.jar x.sgf y.sgf z.sgf On Windows or Mac systems, I'm not sure exactly how to do the same thing, but it should be possible I'm not computer-savvy enough to be able to figure out how to do this. Open a terminal, console, or DOS window -- whatever your system calls it -- and navigate to the folder or directory where the sgf files are. I think that the command to do that is cd {directory} for Windows, Macs, and Linux. (CD = change directory ![]() ![]() |
Author: | daal [ Wed Dec 28, 2011 11:54 am ] |
Post subject: | Re: Merging SGFs |
Thanks Bill, but I haven't managed to get farther than opening a command window. Everything I've typed into it so far has resulted in a dos version of a sceptically raised eyebrow. The sgfs are located in a folder called "tsumego" located at the top level of the partition "D." Can you or anyone else tell me exactly what to type in the command window, and whether I have to type the name of each sgf? |
Author: | Kirby [ Wed Dec 28, 2011 11:59 am ] |
Post subject: | Re: Merging SGFs |
daal wrote: Thanks Bill, but I haven't managed to get farther than opening a command window. Everything I've typed into it so far has resulted in a dos version of a sceptically raised eyebrow. The sgfs are located in a folder called "tsumego" located at the top level of the partition "D." Can you or anyone else tell me exactly what to type in the command window, and whether I have to type the name of each sgf? Type "D:" without quotes to get to the D: drive, prior to using any "cd" command. |
Author: | daal [ Wed Dec 28, 2011 1:53 pm ] |
Post subject: | Re: Merging SGFs |
Kirby wrote: daal wrote: Thanks Bill, but I haven't managed to get farther than opening a command window. Everything I've typed into it so far has resulted in a dos version of a sceptically raised eyebrow. The sgfs are located in a folder called "tsumego" located at the top level of the partition "D." Can you or anyone else tell me exactly what to type in the command window, and whether I have to type the name of each sgf? Type "D:" without quotes to get to the D: drive, prior to using any "cd" command. Thanks, but after typing d in the command module and pressing enter, something appears to the effect of: "The command 'd' is either written wrong or could not be found." But even if I got to "D," I still need someone to explain how to "navigate" to the folder and what exactly to type. Thanks. edit: Here we see demonstrated the failure to impart due importance to little things such as colons. |
Author: | Kirby [ Wed Dec 28, 2011 2:58 pm ] |
Post subject: | Re: Merging SGFs |
daal wrote: Kirby wrote: daal wrote: Thanks Bill, but I haven't managed to get farther than opening a command window. Everything I've typed into it so far has resulted in a dos version of a sceptically raised eyebrow. The sgfs are located in a folder called "tsumego" located at the top level of the partition "D." Can you or anyone else tell me exactly what to type in the command window, and whether I have to type the name of each sgf? Type "D:" without quotes to get to the D: drive, prior to using any "cd" command. Thanks, but after typing d in the command module and pressing enter, something appears to the effect of: "The command 'd' is either written wrong or could not be found." But even if I got to "D," I still need someone to explain how to "navigate" to the folder and what exactly to type. Thanks. Ok. Go to the start menu, and select run. Type: cmd This should open up a command window. The next thing to check is if the java executable - you probably have it - is in the classpath. In other words, you can see if you can execute the java command without specifying the directory. To do that, in the command window, type: java -version Just typing: java could work to. Confirmthat the command is found. Assuming java is found, to make things easier on you, simply look at the directory the cmd window is open to. In windows explorer, copy the jar file you downloaded and all sgfs to that directory. After this, back in the cmd window, type: java -jar sgfMerge.jar x.sgf y.sgf z.sgf where x, y, and z are the sgf filenames you want to merge. If you have more than three sgf files, just keep appending more arguments after z.sgf. If you could not find java, above, let me know, and we can discuss more from there. |
Author: | daal [ Wed Dec 28, 2011 4:19 pm ] |
Post subject: | Re: Merging SGFs |
Thanks Kirby. I found java, but when I ran the command, I got "unable to access jarfile sgfMerge.jar...ah, because it's called sgfMerger..x.x back to typing... Hm. That brought up: "Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to read type -5 at org.igoweb.go.sgf.FileIo.parseParam<FileIo.java:635 at org.igoweb.go.sgf.FileIo.readNode<fileIo.java:349> at org.igoweb.go.sgf.FileIo.readSgf<FileIo.java:299> at org.igoweb.go.sgf.FileIo.<Init><FileIo.java:244> at org.igoweb.sgfMerger.SgfMerger.main<SgfMerger.java:29> Oh bother. This is too much typing anyway. I have hundreds of tsumego files, and this would take forever to type in all the names. There isn't an easier way? |
Author: | Kirby [ Wed Dec 28, 2011 4:22 pm ] |
Post subject: | Re: Merging SGFs |
daal wrote: Thanks Kirby. I found java, but when I ran the command, I got "unable to access jarfile sgfMerge.jar...ah, because it's called sgfMerger..x.x back to typing... Hm. That brought up: "Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to read type -5 at org.igoweb.go.sgf.FileIo.parseParam<FileIo.java:635 at org.igoweb.go.sgf.FileIo.readNode<fileIo.java:349> at org.igoweb.go.sgf.FileIo.readSgf<FileIo.java:299> at org.igoweb.go.sgf.FileIo.<Init><FileIo.java:244> at org.igoweb.sgfMerger.SgfMerger.main<SgfMerger.java:29> Oh bother. This is too much typing anyway. I have hundreds of tsumego files, and this would take forever to type in all the names. There isn't an easier way? I'll tell you what... I don't know much about the jar file - I even made a typo in the name. Sorry about that. Zinstead of this hassle, I'll just write up a script and pm it to you. It'll take a few minutes, but I'll send you something ina bit. |
Author: | kivi [ Thu Dec 29, 2011 2:34 pm ] |
Post subject: | Re: Merging SGFs |
Edit: This is for windows (but other systems almost same, so do say what you have if not windows). You can right click on the tsumego folder while holding the shift key, and select "open command prompt here". Into command prompt type the following. Code: type *.sgf > ..\merged.sgf "type" echoes what is inside a file (similar to "cat" in linux). This will copy the content of all sgf files in that folder into a new file named merged.sgf in the upper folder (of course you can use a better name for the new file). WARNING: If the output file (merged.sgf) already exists, then it will be overwritten. |
Author: | daal [ Sat Dec 31, 2011 5:37 am ] |
Post subject: | Re: Merging SGFs |
Thanks to all for your assistance. Strangely, even kivi's method didn't work on my computer right away (shift right click didn't offer the option "open command prompt here") But since the solution seemed promising, I did figure out enough about navigating in the command window to get to the file where the tsumegos were. Here I'll tell anyone noobier than me how to do it: Now it's time to move on to the next roadblock: how to modify the problems so that the apps recognize the solutions... ![]() |
Page 1 of 1 | All times are UTC - 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |