Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!stc!datlog!mlegge From: mlegge@datlog.co.uk ( Martyn Legge) Newsgroups: comp.sys.ibm.pc Subject: Re: Reading a WP file????? Message-ID: <2799@dlvax2.datlog.co.uk> Date: 21 Mar 90 10:20:42 GMT References: <1771@kannel.lut.fi> Distribution: comp Organization: Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 39 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