home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpm
/
txtutl
/
vn-hzp.lbr
/
SELECT.HZP
/
SELECT.HLP
Wrap
Text File
|
1986-12-31
|
3KB
|
60 lines
**********************************************************************
* SELECT *
**********************************************************************
* COPYRIGHT 1983 EUGENE H. MALLORY *
**********************************************************************
PROGRAM:
SELECT - Select lines from a file based on a pattern search.
USAGE:
SELECT [<fid] pattern [-X] [-N] [-A] [-B] [-H] [>fid]
FUNCTION:
This searches the input for the supplied pattern and outputs
the selected lines. The default is to output lines with the
pattern. Other selection options are:
-X Select lines without the pattern.
-A Select lines including and after finding the pattern.
-B Select lines before the pattern is found.
-N Number selected lines with input line number.
-H Display the available options and metacharacters.
Only one selection option may be used.
The pattern is very general. There are the following options.
* Any number of any characters, from 0 to 132.
? Any single character.
_ A space character.
\ Literal character. Used to include *, ? etc. in pattern.
{ Beginning of line.
} End of line.
@ Any alphabetic character.
# Any number.
! NOT This may be used with any printable character, _,
{, }, @, and #, as well as \char forms. This can be used
to find strings NOT at the beginnnin# or end of a line.
EXAMPLE:
SELECT <PROG.C !;} {Finds lines which don't end in ;}
SELECT <TEXT {} -X >NEWTEXT {Removes empty lines}
SELECT <PROGRAM.PRN ERROR {Lists all lines containing "ERROR".}
COMMENTS:
Because CP/M CCP converts all arguments to uppercase,
this program does all its compares in uppercase. "abc" will
match "ABC" in all cases.
Command Line
___________________________________
|
|
| PATTERN
|
|
______________V______________
Standard Input | | Standard Output
TEXT | | SELECTED TEXT
------------------->| SELECT |----------------------->
| |
| |
|___________________________|