Contents - Index


 

Use FileScan to search a group of files for occurrences of a search pattern. FileScan displays directory information for each file that contains one or more occurrences of the search pattern.  Optionally, the text lines containing the search pattern are also displayed.

 

FileScan may also be entered as FileSc[an], ScanFile, ScFile, or Sc[an].

 

FileScan is supported for BIM and workstation files only.  It is not supported for PDS or VSE files.

 

Optional Operands

 

FILE The format varies based upon the file type:

 

For BIM files, FILE is the directory and the initial characters of the files to be searched.  If no directory is specified (i.e., FILE does not contain a period) files in the currently attached directory are searched.  If the directory is specified but the file is not (i.e., FILE ends in a period), all files in the specified directory are searched.  If FILE is not specified, all files in the current directory are searched.  FILE can contain * and ?  characters, that will match as described in the Extended Search Pattern rules.  If the directory name part of FILE has * or ?  characters, you can search files in more than one directory.

 

For workstation files, FILE is the file name.  The name component may contain workstation global file-name characters.

 

 Default: *.

 

STR is the string to search for.  Up to 72 characters can be specified.  If the value of STR begins with the backslash character (\), the search will use Extended Search Pattern rules.

 

 Default: The value for STR and any other operands not specified will be inherited from previous search commands, also as described below.

 

ZONE is the column range for the search.  Enter it in the format xxx-yyy where xxx and yyy are numbers between 1 and the maximum line width.  For example, ZONE=11-20 signifies columns 11 to 20.  ZONE=5 is the same as ZONE=5-5, ZONE=5-* specifies columns 5 through the session maximum line width, and ZONE=-5 is the same as ZONE=1-5.

 

 Default: If ZONE and STR are not specified, the ZONE specification is inherited from previous search commands, as described below.  If ZONE, after any inheriting, is not specified, the zone is assumed to be 1 through the maximum line width.

 

CASE specifies whether upper/lower case should be considered when determining matches.  If specified as U or I[gnore], case is ignored (the matches The). If specified as M[atch], both case and letters must match.

 

 Default: If CASE and STR are not specified, the CASE specification is inherited from previous search commands, as described below.  If CASE, after any inheriting, is not specified, U is assumed.

 

FMT is the format of the file line display.  The following are provided.

 

NAME displays file name only.

 

DET displays file name, type, attributes, size, and dates.

 

FULL displays the DET information plus user ID and title.

 

CHECK displays information for check out/check in management.

 

 If FMT is not specified, the default format shows NAME, TYPE, and TITLE on a single line.  See the FileLibrary command for more information about FMT.

 

TEXT specifies how the matching text lines should be displayed.  If specified as YES, text lines are displayed in addition to file lines.  If specified as NUM, line numbers are displayed on a separate line before the text lines. If specified as NO, only file lines are displayed.  (The result will look like a FileLibrary display.) If TEXT is not specified, YES is assumed.

 

TYPE If TYPE is specified, only files that match the specified TYPE are searched. If the value of TYPE begins with a backslash character (\), matching will use Extended Search Pattern rules.  See the FileDefine command for information about TYPE.

 

ATTR If ATTR is specified, only files that match the specified ATTR are searched. If the value of ATTR begins with a backslash character (\), matching will use Extended Search Pattern rules.  See the FileDefine command for information about ATTR.

 

CKUSER If CKUSER is specified, only files that have been checked out to the CKUSER user are searched.  If CKUSER is specified as an asterisk (*), all files that have been checked out are displayed.  If the value of CKUSER begins with a backslash character (\), matching will use Extended Search Pattern rules.

 

TITLE If TITLE is specified, only files that contain its value in their TITLEs are searched.  If the value of TITLE begins with a backslash character (\), matching will use Extended Search Pattern rules.

 

FILTER specifies a string or set of strings.  If the STR string is found within a portion of the line where a FILTER string is found, the STR string will be considered to have not been found.  To specify multiple strings for this operand, enclose the strings in parentheses, and separate them from each other by by commas or spaces.  If one of the strings contains a blank, comma, or right parenthesis character, enclose the string in apostrophes (') or quotation marks (").  The following are valid FILTER values:

 

         FILTER=UPDATE

         FILTER=(UPDATE,VALIDATE)

         FILTER=(UPDATE VALIDATE)

         FILTER=(UPDATE,'TARGET DATE OF',VALIDATE)

 

 Although its use is not rejected, the operation of FILTER with respect to Extended Search Pattern is undefined.  In general, this operand should not be used when an Extended Search Pattern is specified for STR.

 

The following Context commands can be used with the FileScan display.

 

ContextAlter

ContextEdit

ContextList

ContextProcess

ContextPrint

ContextDelete

 

The FileScan display file name lines have control information to the right of column 135 for use by the Context commands.  If you use FileScan display lines in another context, you may need to remove the control information using the EditBlank or EditKeep commands.

 

If STR is not specified on the command, BIM-EDIT/XP uses as default operand values from previous search commands.  Using this feature, you can easily request searches that are similar or identical to the last one.  For example, after a Locate command that failed because the instance is backward from the current line, you need only enter

 

   => locateu

 

to repeat exactly the same command in the backward direction.  To achieve this, BIM-EDIT/XP stores a previous value for the STR, COL, CASE, and ZONE operands of the search commands (DeselectPattern, Examine, FileScan, Find, FindFirst, FindUp, Locate, LocateUp, NotFind, NotFindUp, Qualify, ExcludePattern, IntegratePattern, or SelectPattern). These previous values will be inherited by operands omitted from a search command that does not specify STR. Whenever a search command specifies STR, the previous values are set to those specified by that command or not specified.

 

You may interrupt a long-running FileScan command by pressing Ctrl-Break.

 

For scans of workstation files, after creating the session, FileScan performs the scan asyncronously.  You are free to perform other operations while the scan is running.  FileScan appends lines to the session as matches are found.  FileScancan be terminated at any point by closing the session or by pressing Ctrl-Break.  Closing the session causes the scan to terminate and the session to be destroyed.  Ctrl-Break terminates the scan but retains the session.

 

When Valid

 

For host scans, the user must have LIST access level for the directories searched.

 

Return Codes

 

OK Successful.

AT Command interrupted by user.

NF Directory not found.

SC Inadequate access level.

 

Examples

 

Report all occurrences of the string USING within the workstation directory DFH:

 

   => scan \dfh\*,using

 

Report all occurrences of the string USING within the BIM directory DFH:

 

   => scan dfh.*,using