How to use output of mwawFileOSX?

  • David Schmidt

    David Schmidt - 2012-11-03

    Hello -

    Thanks for making this available. I'm hopeful I can make great use of it.

    I have run mwawFileOSX, and have my list of files. How do I feed HERE_is_mwawFile_Result.txt to mwawOSX to actually translate this list of files into .odt format?

  • alonso laurent

    alonso laurent - 2012-11-04

    Hello David,
    mwawOSX can already convert a bunch of files(1) and will only create a resulting .dot
    file if it can convert a file. I create mwawFile so that people can find the format
    of some forgotten files ( and help them to search for an application which can convert
    them ) ; in fact, mwawFile can recognize more formats(2) than mwawOSX can
    convert, you can take a look at the file src/lib/tools/file/file.cpp which is in the
    Libmwaw git repository.

    So just some little ideas

    1) To launch mwawOSX recursively on a folder, the best method is probably to
    modify it, it is an AppleScript which can be edited with AppleScript Editor
    ( in /Applications/Utilities/ ) ; I suspect that others can write more efficient and
    more beautiful AppleScripts than me, so if someone want to help :-) ; if not,
    I will try to see if I can do that :-~

    2) It is also possible to use the Terminal and to write something like that :

    grep :MacWrite HERE_is_mwawFile_Result.txt |sed -e"s/\(.*\):MacWrite.*/ls \"\1\"/" > /tmp/

    sh /tmp/

    which looks for the MacWrite, MacWrite II, MacWrite Pro files, and for each such file
    launches the command ls. After, it is possible to replace ls by myProgram which can
    for instance, choose the name of the conversion file and call mwaw2odt
    (in mwawOSX/bin ) to do the conversion...

    3) Finally, we can also add more output options to mwawFile ; ie. in the main function
    of file.cpp, if someone has some idea...

    Hope that this helps a little,

    (1) you can select a list of files in the Finder and drag them in the mwawOSX icon.
    (2) I will try to add more formats, if I find some free time...

    Last edit: alonso laurent 2012-11-04
    • Anonymous - 2013-12-06

      I don't know whether you are still active with this site. I am trying to convert old cwk files that I have listed in a libreoffice spreadsheet. All the files are either text or spreadsheet files. None are of the other types like draw, presentation, database etc.
      I have a libreoffice basic routine that loops through all the file names. I am a PC guy but this will be running on a Mac. As a PC guy I know little about applescript. My plan is to open each of the files as a cwk file in libreoffice. Once open I want to save it as an .odt file. If the cwk file is a text file it will save it correctly to the same location. If it is a spreadsheet file it will generate an error. I want to trap the error and simply close the cwk file and note in my spreadsheet that it is spreadsheet type. Could I call your convert routine supplying the file name with full path and have it either convert or simply close and return an indication of which. Any help or suggestions would be most appreciated.

      • alonso laurent

        alonso laurent - 2013-12-07

        I suppose that your OS is Windows(1)(2), a system that I have never used. Looking on the web, it seems possible to call LibreOffice directly on a command line, at least, some have success :
        I suspect that this may prove the easier solution.

        The second solution requires to compile and install libwpd, libwpg, libmwaw, the normal way but this may be difficult if you never have compiled an executable...

        The last solution will be to create a small program using the function CWParser::checkHeader as inspiration ( see ). I.e. first read the first byte of the document to determine the file version:v and then go to the position 243 (if v==1),249 (if v==2 or v==3),... and read the file type....

        (1) mwawFileOSX ( which uses AppleScript to create a small interface ) is a version of mwawFile compiled for OSX ; it can not work on Windows/Linux.
        (2) if you use Linux, as libmwaw begins to be present in many distributions ( at least, I have this impression ), this would probably be a lot easier...

        Last edit: alonso laurent 2013-12-07


Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks