newbie_ignoramus has asked for the wisdom of the Perl Monks concerning the following question:

I've got about 50,000 old DOS WordStar files -- dating from the early 1980s to the 1990s -- that I have to translate into standard text files, and eventually turn into HTML. Is anyone aware of any translation modules that will allow me to reformat old WordStar files into standard ASCII text files?

I've had a good look around the web, and I can't find anything.

Replies are listed 'Best First'.
Re: WordStar translation modules
by Joost (Canon) on Apr 17, 2003 at 13:26 UTC
    There seems to be a description of the Wordstar 7.0 format at Wotsit. You might be able to use the info to create your own parser. - Don't forget to put it on the CPAN if you do :-)
    -- Joost downtime n. The period during which a system is error-free and immune from user input.
Re: WordStar translation modules
by Corion (Patriarch) on Apr 17, 2003 at 13:02 UTC

    A long time ago, I did a short foray into the world of WordStar files, and the Wordstar format was relatively simple to parse :

    The format was mostly plain ASCII and special sequences (like font changes) were embedded into it via a special marker (0x27), the length of the special sequence, the sequence, again the length and the marker again (so you could skip it coming from both sides.

    But, as this was when I was a young lad of fourteen years, many winters ago, my memory has become hazy.

    If you have Unix programs available, you could simply run strings -1 <file to see what you get out of this via brute force.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: WordStar translation modules
by bart (Canon) on Apr 17, 2003 at 13:05 UTC
    Not Perl related, but perhaps it might help... Have a good look at this page:
    http://www.icdatamaster.com/convert.html
    as it contains two utilities, WSCONV and WS2HTML. Perhaps those will do what you want.
Re: WordStar translation modules
by PodMaster (Abbot) on Apr 17, 2003 at 13:41 UTC
    If you're gonna write one ;)
    http://www.wotsit.org/
    http://www.wotsit.org/download.asp?f=wordstar -- the specification
    http://www.wordstar.org/?
    http://myfileformats.com/ -- lame clone of wotsit.org
    
    update: I'm glad to see I'm not the only one who remembers wotsit.org (jay Joost). Too bad it took me 20 minutes to complete writing submit this ;)(i was distracted by myfileformats)


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.

Re: WordStar translation modules
by Improv (Pilgrim) on Apr 17, 2003 at 13:01 UTC
    Hey, I don't know about any modules, but if you're on unix, the 'strings' command might help. Try:
    strings mydoc > mydoc.txt
    and see if mydoc.txt has what you want. You also might try visiting this page. Hope this helps!
Re: WordStar translation modules
by frostman (Beadle) on Apr 17, 2003 at 17:29 UTC

    This may or may not help, depending on the nature of your project.

    There is a company that sells software to convert (among other things) WordStar to HTML (or XML). Here's a link:

    stellent.com

    I have no idea how much it costs, but based on the 50K files I'm going to assume you might be doing this for a company that can afford to pay for software, or a nonprofit that might get it for free.

    There is also a free utility for DOS, with cool language features, and it might also do the job (I'd try this first):

    wordstar.org

    Otherwise I'd guess it might be possible to wrap a script around OpenOffice or similar.

    Sorry, I really wanted to say something like use Doc::WordStar qw(convert_to_html convert_to_ascii);

      OOPS I notice now there are a bunch of converters linked to on that wordstar.org page, not just the one.
Re: WordStar translation modules
by bfdi533 (Friar) on Apr 17, 2003 at 20:56 UTC