[net.micro] Wordstar Question

Jackie <Burhans%ECLD@usc-ecl> (02/13/85)

I'm working on a project using Wordstar to enter a class schedule. The
Wordstar file will be sent to a typesetter for formatting and printing.
The information is entered with minimal special codes (no bold, no
underlining, some hard-carriage returns) but it does use tabs.

The file is first entered in readable format and printed so that
it can be proofed for typing/content errors. Example:
347L    2   Woodwind Instruments     53435H   3 MW  Masek   MUS

After proofing we must go back and insert special codes for the
typesetter to indicate when to turn on special fonts/headings etc.,
In addition, the typesetter wants us to remove tabs and use '#' to
indicate when to tab. Example:
[j2]347L#2#Woodwind Instruments#53435H#3#MW#Masek#MUS#

Question: how to search for TAB (CTRL-I) and replace with null
and will this take out extra blanks--that is, does WS store actual
blanks or just ^I? We have tried the global search/replace
command ^QA Find:^I Replace with # Options:gn but it does not
even get so far as finding. NOTE: This strategy works with
^P^B (BOLD) codes but fails spectactularly with ^P^S (UNDERLINE) 
codes in our test file. Any pointers on this will be, of course,
appreciated.

Besides, or rather in addition, any pointers to where I can find
out more about WS format for .WS files so I can write a 
program to read .WS files and strip out some control codes
and replace with special typesetting notations???

Tx.

drick@hplvla.UUCP (drick) (02/21/85)

concerning WordStar files:

If you use document mode, tabs are immediately expanded into spaces.
That's probably why you can't find them w/ search&replace.  In non-
document mode, WordStar leaves the tabs alone.

Some other WordStar stuff I think I remember:

The last letter of each word has the high bit set.
"Soft" carriage returns are different than those you enter 
yourself, but I forget how.  Might be the high bit.  Soft
spaces have the high bit set.  Soft hyphens are actually
SOH or something equally strange.

All this is easily verified by looking at a representative
WordStar file with a debugger.

You can avoid most of this nonsense by using WordStar's non-
document mode.  If you're running WordStar under a CP/M family
operating system, here's one way to get an ASCII file:

1.  Delete all print controls like ^B.
2.  Turn right justify off and reformat everything.
3.  "Print" the document to disk with page formatting and
    form feeds turned off.
4.  Copy the resulting file using PIP with the [Z] option
    to zero the high bits.

One of these days I'll write a little filter in C to do this
translation...

David L. Rick
...hplabs!hplvla!hplvle!drick

drick@ucb-vax.ARPA (02/23/85)

concerning WordStar files:

If you use document mode, tabs are immediately expanded into spaces.
That's probably why you can't find them w/ search&replace.  In
non-document mode, WordStar leaves the tabs alone.

Some other WordStar stuff I think I remember:

The last letter of each word has the high bit set.  "Soft" carriage
returns are different than those you enter yourself, but I forget how.
Might be the high bit.  Soft spaces have the high bit set.  Soft
hyphens are actually SOH or something equally strange.

All this is easily verified by looking at a representative WordStar
file with a debugger.

You can avoid most of this nonsense by using WordStar's non-document
mode.  If you're running WordStar under a CP/M family operating
system, here's one way to get an ASCII file:

1.  Delete all print controls like ^B.
2.  Turn right justify off and reformat everything.
3.  "Print" the document to disk with page formatting and
    form feeds turned off.
4.  Copy the resulting file using PIP with the [Z] option
    to zero the high bits.

One of these days I'll write a little filter in C to do this
translation...

David L. Rick
...hplabs!hplvla!hplvle!drick

bertram@uiucdcsb.UUCP (02/24/85)

	This information comes from Version 3.0 of Wordstar so it may be
out of date for your version but here's what I found.
	In non-document mode (that is files opened with n rather than d)
Wordstar puts actual tabs (hex 09) in the file and these can be searched for
and replaced quite successfully.
	On the other hand when in document mode Wordstar puts in real spaces
when a tab ctrl-I is entered from the keyboard and then searches for tabs
will fail since there are none in the file.
	In regard to WS files I assume that you mean the text-files that
Wordstar produces.  To my knowledge these are pretty much Ascii text unless
you use fancy formatting commands which will set the high bits on some
characters for printing under the control of Wordstar.  You can
probably find a utility like CPM's DUMP which will display the contents
of a file on the console in hexidecimal to investigate what these special
characters are for different formatting requests.


Fred Bertram
bertram@uiucdcs