📄 select.1t
字号:
.\" Copyright (c) 1986-1990 Entropic Speech, Inc..\" Copyright (c) 1992 Entropic Research Laboratory, Inc.; All rights reserved.\" @(#)select.1t 3.14 19 Sep 1997 ESI/ERL.ds ]W (c) 1992 Entropic Research Laboratory, Inc..TH SELECT 1\-ESPS 19 Sep 1997.SH "NAME".nfselect - applies arbitrary queries to select records from FEA files.speselect - applies arbitrary queries to select records from FEA files.fi.SH "SYNOPSIS".B select[.B \-n] [.BI \-c ] [.BI \-q " query"] [.BI \-e " expression"] [.BI \-f " format string"] [.BI \-l " log"] [.BI \-o " output"] [.I "input1 input2 ..."] .SH "DESCRIPTION".PPThis program is stored under the name \fIselect\fR and \fIeselect\fR inorder to avoid a name conflict with the \fIksh\fR builtin command \fIselect\fR..PP.I Selectapplies selection criteria to FEA files. The selected recordsmay be printed and may appended to an internal record buffer, whichin turn may be output to another FEA file. The selection criteriaare specified as a set of queries, with each query being a conditionon the fields in the FEA record..PP.I Selectoperates in two modes: non-interactive and interactive. Thenon-interactive mode applies when the \fB\-q\fP and \fB\-o\fP optionsare used. In this case, the specified query is applied to all of the.I input files and the selected records are writtento.I output. .PPIn interactive mode (no \fB\-q\fP option), .I selectprompts the user for commands (see below). Alternatively, a file ofselection commands can be used as standard input (e.g., \fIselect <command_file)\fP. Command files can also be invoked interactively..PPThe following options are interpreted by \fIselect\fP:.TP.BI \-nNo source files or comments about queries are added to the headersof output files. Normally, the headers of output files are expandedto include the the input files as sources and the selection queries as comments in the \fIvariable.comment\fP field. The \fB\-n\fP option disables this and results in faster operation, especially when the output file already exists and is large. .TP.BI \-c By default, comparisons involving feature fields of type coded are caseinsensitive. When the \fB\-c\fR option is used, these comparisons arecase sensitive..TP.BI \-q " query"Apply the .I queryto the.I inputfiles and write the selected records to .I output(see \fB\-o\fP). .TP.BI \-e " expression"Execute the \fIeval\fR command on the input file and print the result tostandard output. For details, see the \fIeval\fR command below..TP.BI \-f " printf format string"This option allows the specification of a \fIprintf\fR format string tobe used to output the values resulting from use of the \fB-e\fR option.The string can be any valid \fIprintf\fR format string, except that onlythe following character escapes are handled: \\n, \\t, \\b, \\r, \\f, \\\\ (to enter a slash), and \\' (to enter a single quote). (Note inparticular, that \\ddd is not handled.) Keep in mind that the valuebeing displayed is typed \fIdouble\fR inside of the program. So use ofan incompatible output specification will result in garbage dispplay.For example the following option might be used: \fB-f 'Value:\\t%e\\n'\fR or\fB-f Any string: %f units\\n'\fR. The specification string shouldcontain at most one output format control appropriate for double values(%e, %f, %g). .TP.BI \-o " output"Specifies an output file. This option must be used if the .B \-qoption is used, and it cannot be used unless one or more input files are specified on the command line. .TP.BI \-l " log"All user commands, together with all terminal output from.IR select ,will be recorded on a file named.IR log ..PPEach command to \fIselect\fP consists of one or two keywordsfollowed by arguments. The keywords may be abbreviated. Your unixinterrupt character (\fIe.g.\fR ^C) will always terminate the current command.Required portions of the keywords are shown in capital letters in thedescription below;.I selectis not sensitive to case. An EOF is equivalent to a .B Writefollowed by a.B Quit..PPTagged and segment labelled input files involve some special handling inorder to make it possible to associate output records with the sampled datafiles to which the input records refer. If the output file does not exist,and if there is only one tagged input file, then the output file is alsotagged, with the tags being pointers into the same refer file as specifiedin the input file. If the output file does not exist, and if there are twoor more tagged input files, the output file is segment labelled, and alltagged records written to the output file are converted to segmentlabelled. For the case of an existing output file, see the note underBUGS below.For more informationabout taggged and segment labelled FEA files, see FEA (5\-\s-1ESPS\s+1). .TP.BI "@" "comfile ".brThis command causes.I selectto read commands from the file.I comfile ,rather than from the standard input. When end-of-file is reached,.I selectresumes reading from the standard input. Command files may benested; the maximum nesting depth is three. Command files areaborted (all remaining commands are skipped) if an error or userinterrupt occurs while the command file is being read..TP.BI "!" commandShell escape.A shell is forked off to execute.IR command .The command output does not appear in the log file. The exclamation pointmust be in the first column. A "#" character is not considered a comment in.IR command ,since the command may require that character..TP.B CLEarIf the record buffer has been changed since the last write, a warning is printed and the user is asked to confirm. If the useranswers the confirmation request with "yes", the the record buffer iscleared..TP.B CLOseCloses the log file, if any..TP.BI EVal " QUERY"Prints the value of the \fIQUERY\fR expression (seeSYNTAX DETAILS) for each record in theinput set. The record number relative to the input file and relative tothe set of input files (if there is more than one input file) is alsoprinted. .TP.BI From " input1, input2, ..."Closes an existing input files, if any are open, and opens the newones. All input files must be FEA files. Note that an initial setof input files can be specified on the command line..TP.BI HEAder " flags"Prints the headers of the current set of input files, using \fIpsps\fR(1\-ESPS)with the \fB\-x\fR flag. The \fIpsps\fP flags \fB\-frhv\fP may also bespecified. The outputs are run through the.I moreprogram (unless PAGER is set to a different program name; see ENVIRONMENT).The output is not written to the log file..TP.B HELpPrints a summary of the commands accepted by.I select.The help file is run through the.I moreprogram (unless PAGER is set to a different program name; see ENVIRONMENT)..TP.BI Log " logfile"Specifies that the dialog with the user will be saved on.I logfile(equivalent to the.B \-lcommand line option). If a log file is already open, the old log file isclosed and a new file is started. If the argument is omitted, the command isequivalent to Show Log..TP.BI Select " QUERY"Processes the input files one at a time, selects all records thatsatisfy the \fIQUERY\fP, and appends them to therecord buffer. During queries that scan more than 1000 records, a dot will be printedfor each 1000 records scanned.The number of records selected from each file and the total number selected are printed when the select is complete orinterrupted..TP.B "SHow Buffer"Prints the records in the record buffer. The output is run through the.I moreprogram (unless PAGER is set to a different program name; see ENVIRONMENT)..TP.B "SHow FIelds"Prints the field definitions of .I input..TP.BI "SHow FRom" " flags"Runs \fIpsps\fP on the current set of input files. Any of the\fIpsps\fP flags may be specified. The output is run through the.I moreprogram (unless PAGER is set to a different program name; see ENVIRONMENT)..TP .B "SHow LOg"This command tells whether a log file is open, and gives its name ifthere is an open file..TP.B "SHow LAst"Prints the last record in the select buffer. .TP .BI "SHow Select" " QUERY"Processes the input files one at a time, selects all records thatsatisfy the \fIQUERY\fP, andprints them. The number of records selected from each file and the total numberselected are printed. The output is run through the.I moreprogram (unless PAGER is set to a different program name; see ENVIRONMENT).If this command is interrupted with one interrupt character, thenprinting of the records is suspended, but the selection continues. Thetotal records that match the \fIQUERY\fR will be printed as usual. Ifthe command is interrupted for a second time the command will quitwithout checking additional records..TP.BI "SHow To" " flags"Runs \fIpsps\fP on \fIoutput\fP. Any of the \fIpsps\fP flags may be specified. The output is run through the.I moreprogram (unless PAGER is set to a different program name; seeENVIRONMENT)..TP.B "SIze"Prints the number of records in the record buffer. .TP.BI To " output \fR[ \fBWith\fI fieldname1, fieldname2, ...\fR]".TP.BI To " output \fR[ \fBWithout\fI fieldname1, fieldname2, ...\fR]"Specifies an output file. If an output file has already beenspecified, \fIselect\fP closes it and opens the new one provided thatthe record buffer has not changed since the last write. If therecord buffer has been changed since the last write, a warning isprinted and no action is taken. If the TO command is then repeatedas the next command, the existing output file is closed and the newone is opened. Note that an output file can be specified on thecommand line. An output file cannot be specified until an input filehas been specified. Furthermore, the output file, if it exists, musthave a compatible header with that of the first input file (samefield definitions). If the output file does not exist, the \fBWith\fP clause can be used to specify which fields from input records will be written to the output file, or the \fBWithout\fP clause can be used to specify which fields to omit. .TP.B QuitIf the record buffer has not changed since the last write,\fIselect\fP exits. If the record buffer has been changed since thelast write, a warning is printed and the user is asked to confirm thecommand. If the user responds to the confirmation request with "yes",then the program is terminated without writing the output file..TP.B UndoThis command removes the records from the record buffer resulting fromthe last Select command. This command can only be given between aSelect and a Write. Undo cannot be undone. .TP.B VersionPrints out the version number and the date of the last edit (actually, thedate of the last modification of the SCCS database where.I selectis maintained)..TP.B WriteIf \fIoutput\fP does not exist (see the TO command), it is created and the contents of the record buffer are written to it. If \fIoutput\fP exists, the contents of the record buffer are appended. The record buffer is then cleared. .SH SYNTAX DETAILS.PPA \fIQUERY\fR consists of an expression, which has the following form:.nf<expr> ::= <value> | <field_name>{[<index>]} | <character_string> | $<external_function> | <function> (<field_name>) | <function> (<expr>) | ( <expr> ) | <expr> <arith_op> <expr> | <expr> <rel_op> <expr> | \- <expr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -