beautypg.com

How to execute a global search and replace, How to erase the entire work buffer, How to delete specified lines – Gasboy CFN III Manager Manual V3.6 User Manual

Page 194

background image

Using Text Editors

Advanced Editing

Page 18-10 MDE-4871 CFN III Manager’s Manual for Windows® XP Embedded - Version 3.6 · August 2010

How to Execute a Global Search and Replace

Use the command-mode CHANGE command to search the specified line range for a specified
string of characters and replace it with a specified replacement string.

A question mark (?) in the search string is treated as a wild card. It will match any character in
that position. A caret (^) as the first character of the string indicates the beginning of a line. A
caret that is not the first character is not treated specially.

Only the first occurrence of the search string in a line will be changed.

CHANGE Command

To globally search for a specified string and replace it, proceed as follows:

1

If the editor is not in Command Mode, type ^C to enter Command Mode.

2

Type change and, optionally, the line range you want to change.
To specify a range, enter the lower line number, a space, and the higher line number. If you do
not specify a range, the command will act on the whole file. If you specify only one line
number, the command will act on lines from the specified line to the end of the file.
The command line will display the prompt Search mask?.

3

Type the character or characters to change, and press Enter.
The command line will display the prompt Change mask?

4

Type the replacement string.
The editor will print the line numbers, as well as the lines themselves, at the change.

How to Erase the Entire Work Buffer

If you want to start working on a new file, use the command-mode CLEAR command to erase
the entire copy of the file in the work buffer. To protect you from losing a file that you might
really want, the command line will display File buffer not saved, proceed? if you have not
saved or resaved the file since you last made changes.
Note: If you erase the work buffer and then resave, the empty file will overwrite whatever was

in the file on disk.

How to Delete Specified Lines

Use the Command Mode DEL command with, optionally, a line range to erase all or part of a
file. To specify a range, enter the lower line number, a space, and the higher line number. For
example, del 1 3 will delete the first three lines in the file.

If you do not specify a line range the entire file will be erased. If you specify only one line
number, the lines from the specified line to the end of the file will be erased.

This manual is related to the following products: