WP51 Center - Macros   
  Voice Pro Home | WP51 home | macros | how to | quick tips | links | feedback          Just for MTs  WP51 Forum

   

The Medical Banner Exchange
This site is a member of the Medical Banner Exchange

    Freeware - Line Count Program

Date Macros

MT Sticky Notes

Screen Saver Macros

Diskette Jacket

Dear Doctor

Not Normal

Compare Log/Reports

Count Occurrences

Envelope Creator

Calculator

Freeware - Line Count Program

F7 Key Replacement

Hyphen Generator

Funnel

Transpose

Capitalize

Line Count

 

About this Line Counter

Elsewhere on our site, you'll find a line count macro. As line counters go, it's not an awful way to count lines, but I do think it's a bit pokey. Its main advantages are that it allows you to count characters from within a WP51 document using just a macro, it writes a report, and it's configurable. The line counter offered on this page, on the other hand, is a small non-macro, DOS-based program that is fast, accurate, reliable, and counts gross lines.

The program comes from a transcription service, Pegasus Transcription Plus, in which I previously held a partnership interest. We hired a programmer to write a line counter to our specifications (thanks, Don, wherever you are), used it in our business, and provided it free of charge to our transcriptionists. We were often asked if we would share it with other services or individual transcriptionists, but we chose not to because the program was proprietary, central to the way we operated, and provided billing verification to our clients.

However, all things change eventually. Pegasus is gone, and in my new company, Voice Pro, I use a different type of line calculation and counting software. Recently I asked my former partner if she had any objection to my giving away the old line counter, and she raised no objections at all (thanks, Susan!).

This line counter was used successfully for over a decade to count gross lines at Pegasus. It can function as a standalone program, be used with files originating in any word processor (if that program saves files to a DOS text format), and be integrated with the use of an add-on macro to run from inside (kind of) WP51. Here's what the program won't do:

  • it does not write to a report on its own (although, it can, with your help, using an add-on macro)
  • it does not deal well with tables (although, it can--again, using an add-on macro)
  • it does not do "fancy" line counts. By that, I mean that it does not count extra for a bold, underline, or whatnot (although, again, it can with the help of a macro)

On this page, I'll explain how the program works, give full instructions for its simplest installation and use, supply the basic program, offer one modified version of the program and an explanation of its differences, and provide a basic macro and batch file to run it. Further modifications of its functions are up to you, although I'll give you some ideas on how to effect those modifications.

Download links are at the bottom of this page. Instructions follow.

How Does it Work?

The program, in its simplest form and installation, counts gross lines in a DOS text file. That is, when the program parses a line with a hard return plus one or more characters (anything within the ASCII character set, including numbers, spaces, letters, some symbols, and punctuation), it increments the line count by one. If the program parses a line with a hard return and no other characters, it does not increment the line count. This is the count most commonly referred to as the "gross line" method -- anything on a printed line is a line.

Arguments for and against the gross line count are endless. I'm not going to enter the line count algorithm fray here! I'm also not suggesting that you use a gross line count; I no longer do myself. However, if you do use gross line count, this is a great little tool.

How to Install the Program

The program consists of one file, counta.com, which you should install in a directory that is accessible through your path statement. If you don't know what a path statement is or how to modify it, here are two suggestions:

  • If you're running Windows, put the file in the c:\windows\ directory (making sure that you're not replacing a file of the same name already in the directory!)
  • If you're running DOS/no Windows, put the file in the c:\ directory

I'll provide a batch file, linesa.bat, that runs counta.com for use with macros. Place this, too, in a directory that is accessible through your path statement.

If you use the macros, place them in your macro directory.

Using the Program

Let's discuss the most basic scenario. Note that I didn't say "easiest," just most basic. There are much, much easier ways of using the program (I'll show you how a bit further along), but I think you ought to know how it works. You've installed counta.com in your c:\windows directory, and you have some word processor open with a file on screen that you would like to count. What's next?

  1. Save the file first! Save it in the format you use for your final product.
  2. Now, save the file again into the same directory where you placed counta.com. Save it as a DOS text file with line breaks. In WP51, for instance, you would use: [CTRL][F5] + [T] +[S] . In MS-Word, as another example, you would select File, Save As, Type=DOS Text with Line Breaks.
  3. Go to DOS, using whatever method you'd like. From WP51, drop to DOS with this key sequence: [CTRL]+[F1] + G . In Windows, you can just open a DOS Window (usually the command is found on your Start button / Programs menu). However you do it, though, get to DOS.
  4. In DOS, if necessary, change directories to the one where counta.com is. (cd c:\[path])
  5. Type in the following command: counta
  6. The program will start up in your DOS window and ask for the input file. This is the name you used when you saved your file to DOS text. If you enter a nonexistent file name or a file name that is not in the current directory, Counta responds with this error message:
    I/O error 01, PC=2DE9 Program aborted
    Otherwise, CountA responds with a brief "working" message and then your line count.
  7. Close your DOS window. You're done.

Making it Easier

Now that you know how the program works, let's talk about how to make it easier to use the program. First we can write a batch file that runs the program. Second, because the program is in a known directory, we can write a macro that always saves a DOS text copy of our file into that directory and also calls the batch file. Finally, we can remap our keyboard to call the macro from, for example, [CTRL] + [C]. Together, this gets all our many steps down to a hot-key, enter, a file name, and enter. Nifty, eh?

I'm providing the macro and batch file in the program zip at the bottom of the page. Both macro and batch file are written with the assumption that you have placed counta.com in the c:\windows directory, but this can be edited. Remember that if you edit the batch file, you'll need to save it as plain DOS text, or it will cease to function! Below are brief explanations of the batch file and macro. Line numbers are for reference only and do not exist in the files. Bracketed comments are for explanation purposes and also do not exist in the files.

linesa.bat batch file contents:

1) c:\windows\counta.com       [calls the line counter]

2) Pause       [pauses the batch file so that you have a chance to record your line count]

countmac.wpm macro contents:

1) {DISPLAY ON}

2) {PROMPT}PressˇF1ˇtoˇcancel;ˇPressˇ[ENTER]ˇtoˇcontinue:ˇˇ~       [gives you a chance to back out, in case you forgot to save your document]

3) {PAUSE}       [waits for you to press enter]

4) {DISPLAY OFF}

5) {LABEL}count~

6) {Text In/Out}tsc:\windows\count{Enter}y       [saves your file as a DOS text document named "count"]

7) {Exit}nn       [exits out of your on screen document]

8) {Shell}cc:\windows\linesa{Enter}       [runs the batch file that runs the program]

Alternate Program - countb.com

Countb.com is a modification of the basic gross line count program. How is it different? Basically, if a line is less than 50 percent of a "normal" line, then that line only counts as one-half line. A normal line, for this program, is defined as 80 characters of any type. So, one-half line is any line with 39 or fewer characters on it.

If you use countb.com, remember to change the program name appropriately in your batch files and macros. Also, you can certainly use both programs at different times, calling counta.com from one macro and countb.com from another.

Why? You can use this line count for customers who like the convenience of a gross line count (it's visual and easy to verify) but who object to paying full price for a line with five characters on it. Again, I'm not going to get into the question of whether this makes sense! Frankly, the only kind of line count that makes sense to me is the character-based line count. Still, if you need it, this modification exists and is included in the zip file.

It isn't Pretty!

No, it's not pretty, and the program messages have a missing apostrophe. This little utility wasn't written by an MT, it was written by a programmer who was more concerned with function than grammar. What it lacks in style, it makes up for in speed and function.

Ideas

Modifying the program, or, more appropriately, integrating the program with your procedures is fairly easy. Here are some ideas:

  • If you need to count tables, this program is not your best choice, but it can be used. Keep in mind the way WP51, and other programs, convert tables to text. Try it, if you're unfamiliar with how your program performs table conversion. Your line count may increase or decrease dramatically. To get around this in WP51, you can insert a snippet of code into your countmac.wpm macro that will delete your table definitions and convert the results to regularly formatted lines. The proviso I would add is that this may or may not result in an exact number of lines for the table. It won't be far off, but it may be off. If you just allow the tables to convert when you save to DOS text, however, the line count wil be far, far off, because each cell will convert to its own page.
  • I haven't given any macros to use this program with Word or windows-based Corel WordPerfect versions, but you can write your own. Remember that the program doesn't count files in their native format but in DOS text format, so as long as your program will save to DOS text, you can use this program.
  • If you need the program to write to a log file, just put the logging routine macro code into the countmac.wpm after the return from DOS.
  • If you want to count extra for formatting characters (and, by the way, I don't endorse this line counting method) you can do so (at least in WP51) by converting the hidden format codes to characters before saving the file to DOS text.

What's in the Zip?

  1. counta.com
  2. countb.com
  3. linesa.bat
  4. linesb.bat
  5. countmac.wpm
  6. this page
  7. Terms of Use

Last Thoughts

I've deployed this little program on many different machines with many different configurations. I never had a problem running it. That said, this is the first time we've offered the program to the MT community at large, and I have no doubt that it won't work on somebody's machine!

If you have problems with the program or problems with its installation, please feel free to email me.

Finally, you are free to copy and distribute this line count program in accordance with our Terms of Use (link below). If you have any questions about what you can and cannot do with the program, please email me.

Download Line Count Program, Example Macros, and Batch Files

Terms of Use




Pssst! Can you spare a moment?

We'd like to know if this page was helpful to you today
and how it might have been more helpful.

Please answer the four questions below and click submit.
You'll be returned to this page pronto!

How helpful was the information presented about the Line Cout Program?
(1=Extremely and 5=Not at all)

1
2
3
4
5

How would you rank the skill level required to use information found on this page?
(1=Complete beginner could use this information
and 5=Requires an expert to understand)

1
2
3
4
5

What brought you to this page?
I regularly visit this site.
I came to this page to find information on a specific topic.
I was just browsing.
I was looking for information on another word processor
I followed a link here, but this site isn't relevant to my search.

Is there anything we might do to make this page more helpful?

Thanks for your comments and opinions.
Click Submit and you'll be returned to this page.



  Voice Pro Home | WP51 Center | macros | how-to | quick tips | links | feedback           FAQs
Voice Pro, Inc.   

Copyright © 2000-2001 Voice Pro, Inc.
Portions Copyright © 1995-2001 Mitzi L. D. Ponce

WordPerfect is a registered trademark of Corel Corporation.
Windows is a registered trademarks of Microsoft Corp.
This site is not affiliated with Corel Corporation or Microsoft Corporation.



web site design by
Nightshade Systems