|
GREPName:
For Unix/Linux/MacOS systems, the GREP command issues a
command to the operating system. For Windows systems, the GREP command issues a
command to the operating system. The string that follows the GREP on the command line is passed to the operating system as is. Dataplot does no error checking of this string. This is a system dependent command. It is currently supported for Unix/Linux/MacOS and Windows platforms.
where <str> is a string to be matched; and <file-list> is a string specifying the files to search. If <str> contains spaces, it should be enclosed in quotes.
GREP RESSD *.OUT GREP FIT *.DP > FIT_COMMANDS.OUT
The motivation for adding this as a separate command is to allow the capability to be implemented in an operating system independent way. This can be useful when writing general purpose macros that may be used on different operating systems.
The SEARCH command has the advantage that it can find files in the Dataplot directories without specifying the full path name and supports a few special keywords for a few specific files. The GREP command has the advantage that it can search multiple files and you can use wild cards in specifying the file names to search. The GREP command is also not limited to printing a maximum of 80 characters for matching lines.
By default, the search will not be case sensitive. To specify a case sensitive search, enter the command
To reset the default of case insenstive search, enter the command
This adds an "/I" option under Windows and a "-i" option under Linux. If you specify a directory name to search and you want the files in that directory to be searched, enter the command
To reset the default of no recursive search, enter the command
This adds a "/S" option under Windows and a "-r" option under Linux. By default, the line number in the file where a match is found will be included in the output. If you want to suppress the line number, enter the command
To reset the default of including the line numbers, enter the command
This adds a "/N" option under Windows and a "-n" option under Linux. If you only want to return lines that match exactly, enter the command
To reset the default of not requiring an exact line match, enter the command
This adds a "/X" option under Windows and a "-x" option under Linux. If you want to return lines that do not match, then enter the command
To reset the default of not requiring an exact line match, enter the command
This adds a "/V" option under Windows and a "-v" option under Linux. If you want to only print the file name where a match is found, enter the command
To reset the default of including the specific lines in the file that match, enter the command
This adds a "/M" option under Windows and a "-l" option under Linux. If you want to use options not supported by one of the above SET commands, you can enter them manually. For example, under Linux you can do something like
The "-w" match will only match FIT where FIT is a complete word in the file.
The first way is to use the CAPTURE command. For example
GREP FIT *.DP *.TXT END OF CAPTURE Alternativey, you can use the ">" syntax at the end of the command. For example
grep FIT *.DP *.TXT macros/*.DP macros/*.TXT
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 09/13/2019 |