![]() |
Counting The Number Of Characters In A Docume |
The information in this document applies to:
WordPerfect® 5.1 for DOS
Problem
Symptoms: Can you get an accurate character count of a document if you save it out as ASCII Text? Solutions: This depends on how the file is saved out. If the file is saved as DOS Text it may give different results than if it is saved as a Generic file. When you save a file out as DOS Text, each character is equal to one byte with the exception of hard returns which are two bytes (0Dh 0Ah). A hard page is one byte (0Ch) and soft pages are not retained in a DOS Text file. Remember that spaces are also considered characters (20h) so this may not be an accurate way to determine how many actual characters are in a document unless you know how many spaces there are as well. One extra byte is also added to the file because when you save a WP51 file as DOS Text an end of file marker is placed at the end of the file. For example, if you create a document in WP 5.1 that contains the following text: this is a test[HRt] this is a test[HPg] and then save it out as DOS Text, it would have 32 bytes (22 characters, 6 spaces, 2 bytes for the hard return, 1 byte for the hard page plus 1 byte for the ^Z). How/Why: When WP saves a document out as DOS text, basically everything in the document that has a valid ASCII value is retained (characters, spaces, hard returns, and hard pages) codes that do not have an ASCII equivalent (underline, bold, date code etc.,) will be stripped out. Another problem is that tabs are converted to a variable number of spaces. |
Answer:
Details:
Product specifications, packaging, technical support and information (*Specifications*) refer to theUnited States retail English version only. Specifications for other versions may vary. All Specifications, claims, features, representations, and/or comparisons provided are correct to the best of our knowledge of the date of publication, but are subject to change without notice.OUR MAXIMUM AGGREGATE LIABILITY TO YOU AND THAT OF OUR DEALERS AND SUPPLIERS IS LIMITED. IT SHALL NOTEXCEED THE AMOUNT YOU PAID TO ACCESS THE INFORMATION. SEE LEGAL DISCLAIMER. |