WinMGT to SLF Converter

    Keywords: Software

This page needs wiki master editing.


The WinMGT2SLF converter is the utility written by HolIgor which translates WinMGT (TM) ascii output to Sensei's Library Format (SLF (TM) :-) output.

Download
Executable: [ext] http://senseis.xmp.net/files/converter/txtcon.exe
C++ Source: [ext] http://senseis.xmp.net/files/converter/txtcon.cpp.txt

This is a place for comments on the utility.


Procedure

  • In WinMGT go to the board position you want to convert
  • File -> Save board image to -> text file, e.g. as "exercise.txt"

The file should look something like this

    A B C D E F G H J K L M N O P Q R S T
 19 X X X . . . . . X X O O O X X O O . O 19
 18 O X X X . . . X X O . O . O X O O O . 18
 17 O X X . X X . X O O O X O O X . O O O 17

etc...

  • Suppose you have saved that file in the same directory as the program txtcon, e.g. c:\senseis
  • Open the command prompt
  • At the prompt, type "c:\senseis\txtcon c:\senseis\exercise.txt c:\senseis\converted.txt"

The directory "c:\senseis" will then contain a file "converted.txt" with the position in Sensei's Library Format (TM).


To convert a SL diagram to an SGF-file, simply click on the diagram.


Past comments: HolIgor, (awesome contribution!), Dieter Verhofstadt


Dieter please cut and paste the first few lines of your source file so we can see what it looks like. The utility works for me. My input is from the 'save board image to text file' command in WinMGT. The file looks like this:

    A B C D E F G H J K L M N O P Q R S T
 19 X X X . . . . . X X O O O X X O O . O 19
 18 O X X X . . . X X O . O . O X O O O . 18
 17 O X X . X X . X O O O X O O X . O O O 17

etc... -- Dave Sigaty


The utility is very primitive. It does not check if the input file is really a board txt image like the one that is shown above in Dave's comment. It is does not recognize any special marks that could be made by an sgf editor. I wrote it as a simple instrument to make typing the whole board positions semi-automatic.

Let me see your txt file and I can correct the program.

  Holgor

HolIgor you crazy genius!!! -- Dave Sigaty

Thanks, this is really cool. I'll try it as soon as the phone company fixes the rain damage to my home lines. Since i don't have WinMGT at work (which is where i usually peruse SL), but do have Jago... what would i need to do to get txtcon to work with Jago? -- TakeNGive (11k)


It seems to me that the format of txt image of the board in Jago is similar to WinMGT. So, the utility should work with it. Try it and if the result is somewhat funny inform me about it. A slight modification may solve the problem.

By the way, I believe that the format of the txt image of the position produced by other programs such as sgf2misc is similar, so there should not be any problem with it. Side note, as soon as a tiniest software is produced the real problems of support and portability begin :).

  HolIgor

Jvt asks:

Is there a program for converting Sensei's Library format into SGF?

HolIgor is the first and only one to program something for SLF, as far as I know.

I suppose there are many utilities out there for converting text diagrams into SGF,

I'm not so sure about that.

but do they accept borders as defined in SLF? If there are several available utilities, which one is the simplest to use?

BTW it would be nice to include such a conversion utility (SGF to SLF and back) in the edit page.

Has been done in How Diagrams Work

I can write a servlet if the administrators are interested. Maybe it could be done with JavaScript too, but I don't know much about JS.

About Holigor's utility: maybe the direct links would work if he adds a link to it on his web page. I suspect the web server refuses to retrieve the file if the URL is not accessed from a page hosted on the site, to prevent users from storing files without (local) HTML links.

The direct links are now on the SL-server itself. -- Dieter

Is it possible to use the online SLF to PNG conversion offline by downloading some utility for this purpose? -- Robert


Please write an utility that converts a whole SGF-File to a (large) file containing for every position two SL-diagrams:

  • one diagram with caption "Black to move", just the position
  • one diagram dto, containing also the following 10 moves

and also caption "Move #124" plus the text comment!!

You can assume that the file is without variations & illegal moves (=a regular game file) (Placement of handicap stones is needed, marks not necessarily)

The user can then use cut&paste to create his SL-page.

...not as convenient when you have several positions+don't know the move numbers. Perhaps this php-file can be changed to do the conversion for all moves.


Dieter: My folders have blanks in their name. How to make txtcon accept it?

unkx80: In Windows, enclose the entire filename in quotes, i.e.

    txtcon "in file" "out file"

In Unix/Linux, use the "\" character to escape the space, i.e.

    txtcon in\ file out\ file

The program did not compile out-of-the-box for me. The reason is that C++ does not guarantee that copies of istream/ostreams can be made, the function signature of txtconv has to be changed to take stream references.


See also: Generate Diagram From SGF


This is a copy of the living page "WinMGT to SLF Converter" at Sensei's Library.
(OC) 2011 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About