Article View: comp.text
Article #4717Re: Wordstar to MAC ?
From: Chuq Von Rospach
Date: Wed, 18 May 1988 23:18
Date: Wed, 18 May 1988 23:18
87 lines
2677 bytes
2677 bytes
>My wife has a thesis in wordstar on a PC and now that we have a mac
>she wants to move it over to the MAC.
>Does wordstar have the ability to write (msword, RTF) file formats?
>I would like the formatting to transfer but forgoeing that, how do we
>save straight text files in wordstar?
Coincidentally, one of my authors writes with a PC and Wordstar. Since I
need to move the text to my Mac for layout. I'm primarily interested in the
text, but I tried to save some of the formatting in a way that I can use it
as a guide during layout.
What I do is load the text files onto my Unix box here via PC-NFS, then run
the enclosed program on it. It does a pretty good job of parsing out a
WordStar file and cleaning it up. After that, I download it from my Unix box
to my Mac.
This program is a really dirty hack, but wotthehell. And if you can get
fiels directly from a PC to a Mac, you should be able to compile this thing
with LightSpeed C and cut the middle-machine out completely.
Anyway, this should give you ideas...
chuq
-----
/* This will unpack a wordstar file reasonable cleanly */
#include <stdio.h>
#include <ctype.h>
main()
{
int c;
int nl = 0;
int nb = 0;
int first = 0;
while ((c = getchar()) != EOF) {
if (!isascii(c)) /* strip high bits */
c = toascii(c);
if (iscntrl(c) && c != 10) { /* control chars, excelt \n */
if (c == 13 || c == 26) /* ignore ^M and ^Z */
continue;
else if (c == 19) /* ^S, italics */
printf("(I)");
else
printf("|%d|", c); /* Anything else */
} else {
if (c == 10) {
if (nl) { /* if we just printed a \n, don't dbl space */
nl = 0;
} else {
nl++;
putchar(c);
first++;
}
} else if (c == 32) { /* removing excess spaces */
nb++;
if (nb == 5) {
nb = 0;
if (!nl) {
putchar('\n');
first++;
nl++;
}
}
} else {
nl = 0;
if (nb && !first)
putchar(' ');
nb = 0;
putchar(c);
first = 0;
}
}
}
putchar('\n');
}
Chuq Von Rospach chuq@sun.COM Delphi: CHUQ
Robert A. Heinlein: 1907-1988. He will never truly die as long as we
read his words and speak his name. Rest in Peace.
Technical Details
Message-ID:
<53757@sun.uucp>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!oliveb!sun!plaid!chuqReferences:
<15642@uflorida.cis.ufl.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!oliveb!sun!plaid!chuq From: chuq@plaid.Sun.COM (Chuq Von Rospach) Newsgroups: comp.text Subject: Re: Wordstar to MAC ? Message-ID: <53757@sun.uucp> Date: 18 May 88 23:18:20 GMT References: <15642@uflorida.cis.ufl.EDU> Sender: news@sun.uucp Reply-To: chuq@sun.UUCP (Chuq Von Rospach) Organization: Fictional Reality Lines: 86