Dselect [ options ] Dl-expression [ input-file.. ]
Dselect [ options ] [ -f Dl-expression-file ].. [ input-file.. ]
Dselect reads records from the input-files evaluating the Dl-expression, and when the result is TRUE, copies the input record to the standard output.
See the manual of Dl for the Dl-expression. The restriction for Dl-expression used in Dselect is that no modification of the input record or output to the file is allowed.
Field "count" value is greater than 1:
Dselect count:n ">" 1
Dselect NUM FIELD count GT 1
(Above examples produce same result. Note that :n or NUM is required.)
Field "keywd" values have character string "database" or "DB" in it:
Dselect keywd =~ database OR keywd =~ DB
Same condition:
Dselect keywd =~ "{" database DB "}"
All of field "keywd" values are alphabet only words, starting with a capital letter, followed by small lettters:
Dselect NOT keywd UNLIKE "^[A-Z][a-z]+$"
(UNLIKE tests if there is at least one such value.)
Field "mark" value (exists at most one) has value *:
Dselect mark == CONST "*"
(You need CONST because "*" is a reserved word.)
Field "mark" value (exists at most one) has value + or *:
Dselect "{" "+" "*" "}" INCL FIELD mark
(Keyword FIELD is mandatory. Without it, "mark" becomes a constant.)
Extracting a record from every 100 records:
Dselect REC# % 100 == 1
Case insensitive search:
Dselect CAPS keywd =~ TOKYO
See the manual of D_msg.
MIYAZAWA Akira