The Graham Utilities for OS/2 - Version 2


[Warpspeed]

[Table of Contents] [Index] [Previous] [Next]


WC - Word Count

Summary

Word Count is a simple utility which enables you to count the number of characters, words and lines in text files.

Icon

Command Line Format

Usage: WC {Switches} <File Spec> Drive Spec(s)

Switches

-a
All disks.
-h
Hard disks only.
-s
Include subdirectories in the search.

Note : If no file specification is entered, all files are listed. If drive specifications are entered then those drives are searched. If no drive specifications are entered then the current drive is searched.

Description

Word Count is a simple utility which enables you to count the number of characters, words and lines in text files. It lists the individual characters, words and lines of each file as well as the totals of each.

-a All disks

WC will scan all logical disk drives defined by the system, starting at drive A:. The drives are scanned in order, starting at A:, then B: and so on.

-h Hard disks only

WC will scan all logical disk drives defined by the system, starting at drive C:. The drives are scanned in order, starting at C:, then D: and so on.

-s Subdirectories

WC will include subdirectories as part of its search of the specified disk drives. If a subdirectory name is included as part of the file specification, then the search will include that subdirectory and all subdirectories below it. If no subdirectory is given as part of the file specification, then the current directory and all subdirectories below it are included in the search.

Examples

WC *.c
WC will look for all .C files and list the number of lines, words and characters in each, as well as the total number of lines, words and characters.
WC C:\*.TXT /s
WC will display the number of characters, words and lines of all .TXT files on drive C:.