[comp.sys.ibm.pc] Reading a WP file?????

cale@kannel.lut.fi (Antti Kirmanen) (03/16/90)

	Can anyone tell me how to read a Word Perfect file??
	I should make a program which reads text written with WP.

	The problem is that WP inserts a lot of control characters
	in the file. In the beginning of the file there is a lot of
	information about settings etc. I do not have to know, what 
	these control characters exactly mean, I should only know, how to
	find the beginning and the end of the text and is there some other
	information about the file.

	The main questions are:


	1. How can I know where is the beginning of the text.
	   Is there some kind of control character, which indicates
	   the first line or is there somewhere in the header 
	   information about the size of the header. I've found
	   out, that on bytes 5-6 there is some information about
	   the size of the file, but what does those bytes mean??

	2. Same question about finding the end of the user-written text.


	I would be very thankfull, if someone could tell me about the 
	the header file or if someone could tell me where to find help.

	ps. I know, that there is a program CONVERT in the Word Perfect
	    disks. The program is not suitable for me and it isn't
	    possible to use a dos-saved file.

------			
      ***********************************************************
      *  internet:                  	*  Kirmanen Antti	*
      *    cale@kannel.lut.fi		*  FINLAND		*  
      ***********************************************************

francis@cunixf.cc.columbia.edu (Francis Ho) (03/17/90)

In article <1771@kannel.lut.fi> cale@kannel.lut.fi (Antti Kirmanen) writes:
>
>	Can anyone tell me how to read a Word Perfect file??
>	I should make a program which reads text written with WP.

which version are you using?

>	The problem is that WP inserts a lot of control characters

try switching to save as ascii/text

>	information about settings etc. I do not have to know, what 
>	these control characters exactly mean, I should only know, how to
>	find the beginning and the end of the text and is there some other
>	information about the file.

again, as ascii it inserts the ^Z

>	I would be very thankfull, if someone could tell me about the 
>	the header file or if someone could tell me where to find help.

>	ps. I know, that there is a program CONVERT in the Word Perfect
>	    disks. The program is not suitable for me and it isn't
>	    possible to use a dos-saved file.
why not?

>      ***********************************************************
>      *  internet:                  	*  Kirmanen Antti	*
>      *    cale@kannel.lut.fi		*  FINLAND		*  
>      ***********************************************************

/f

$**********$****************$*************************************$**********$
* Francis Ivanos Ho  USnail | 531 West 113th St. NYC 10025	  *   \    / *
*____/\____*         bitnet | francis@cunixc.bitnet               *    [__]  *
*   /  \   *       internet | francis@cunixF.cc.columbia.edu      *  v \oo/  *
*  /<()>\  *           UUCP | ...!rutgers!columbia!cunixF!francis *   `/#/-c *
* /______\ * Columbia Center for Computing Activities (CUCCA)...  *  _/  \_  *
$**********$****************$************************************************$
--I just want to be me so I speak for myself.

mlegge@datlog.co.uk ( Martyn Legge) (03/21/90)

cale@kannel.lut.fi (Antti Kirmanen) writes:


>	Can anyone tell me how to read a Word Perfect file??
>	I should make a program which reads text written with WP.

>	The problem is that WP inserts a lot of control characters
>	in the file. In the beginning of the file there is a lot of
>	information about settings etc. I do not have to know, what 
>	these control characters exactly mean, I should only know, how to
>	find the beginning and the end of the text and is there some other
>	information about the file.

>	The main questions are:


>	1. How can I know where is the beginning of the text.
>	   Is there some kind of control character, which indicates
>	   the first line or is there somewhere in the header 
>	   information about the size of the header. I've found
>	   out, that on bytes 5-6 there is some information about
>	   the size of the file, but what does those bytes mean??

>	2. Same question about finding the end of the user-written text.


In wp 5.0 and 5.1 Bytes 2-5 of the file are a 32 bit integer which is the
offset in the file to the user text in the document.  Byte 6 has nothing
to do with the file size.

The user text goes from that offset to the end of the file.  However,
the user text is not stored in plain ascii.  It is intermingled with all
sorts of formatting information so finding it in the file
may not do you any good.  You do not say what the
objective of finding the user text is, you may achieve what you want
by exporting to ascii using Text in/out.

--
Martyn