Dec 232017
This file is very useful, you can search multiple files for strings and then replace them.
File SRUV35.ZIP from The Programmer’s Corner in
Category Word Processors
This file is very useful, you can search multiple files for strings and then replace them.
File Name File Size Zip Size Zip Type
ORDER 626 226 deflated
SRU.DOC 11593 4315 deflated
SRU.EXE 203995 92179 deflated
SRU.INF 1129 569 deflated

Download File SRUV35.ZIP Here

Contents of the SRU.DOC file

SRU v3.5 November, 1989
Search and Replace Utility

Copyright (c) 1988, Dan Fugitt Telcom Services, all rights reserved.

You can view this document from within the SRU program by pressing F1 key.
(SRU.DOC must be in the default directory).

If you use SRU you are encouraged to register.

SRU registration is $20. This entitles you to the latest version of SRU
and a copy that does not have this message popup everytime you enter the


Please send check, with your name and address to:

Dan Fugitt /Telcom Services
2603 Carmel Drive
Carrollton, Tx. 75006


The author retains all rights to the program and grants a limited
license to the end user under the following terms and conditions:

1. This program may be distributed freely as long as it is not
used as part of a commercial package.

2. The SRU.DOC file is distributed along with SRU.EXE

3. The author's copyright information is not altered in any matter
from it's original form.



SRU is a programmers tool. If you do not program in a modular language,
you probably don't have much use for this utility. However, if you work
with a language that requires you to maintain many source files (Clipper,
dBase, Foxbase, C), you will find it a very handy tool.

If you use 'Grep', then you already understand the basic concept of SRU,
locate text in multiple files. SRU goes a step further by letting you
modify the specified text string.

Unlike 'GREP', the string may consist of more than one word.

SRU supports ASCII source files only. However, it will load and search
any file extension type EXCEPT: *.*, .EXE, .COM, .DBF, .NTX, .NDX.
So be careful. SRU can corrupt non-ascii files...

SRU's search is always confined to the default directory.

SRU is a search and replace utility designed primarily for coders.
Too often I find myself loading source code files into a word processor
and doing a find and replace on each file for the same code or string.
As a developer this is especially true since I find myself going through
many source files and replacing statements with a function, replacing
memvar names with new names etc. Even if you use some of the more
'programmer oriented' editors like QEdit that will load multiple files
into memory, you must still edit one file at a time. SRU will do'em all
in one swoop.


Filespec: *.PRG (Limit files to "*.PRG" extension.)
Prompting: No (Don't ask for verify every file..)
Grep Mode: No (Don't display the file...........)
Search For: SET CURSOR ON (String to search for.............)
Replace with: CURS(.T) (String to replace with...........)

Results in:

1. SRU will search every file in the current directory with a .PRG
extension, for the string SET CURSOR ON. (Every .PRG file is
searched only if you have selected 'all' files. You may
specify a single filename or all.)

2. SRU will make a backup of every file before modifying it.
(with an .SRU extension)

3. SRU will replace every occurence of SET CURSOR ON with the new
function name and paramater CURS(.T.) in the selected files.



SRU is cAsE sEnSiTiVe, and will search for a string 1-60 characters in
length. Don't worry about trying to match the replacement string size
to the search string size, just try to keep the string length within
reason. I recommend that you try SRU on a couple of files to get a
feel for what the modified file will look like. I use it extensively
and to date have had no problems in any way. The strings can be up to
60 characters long, so it is possible that the modified file could
have a long line after the replace command has executed. This should
not be a problem since most modifications are usually less than 60
characters long.

SRU renames your original file to the original filename with a .SRU

Your original file is unalterd. The modified file will be named to the
original file name with its original extension. This will allow you to
check the modified file for correctness. You can always do a DEL *.SRU
command to get rid of the old files.

Note: SRU only creates a backup file (.SRU) if a string is found and
replaced. If no string is found, there is no reason for a
backup file.

SRU displays plenty of real-time registers so you always know whats going
on with your source files. SRU always displays the filename being
modified, and how many modifications are being performed.


SRU Main Menu Items:

FILESPEC - (Must be performed to select an array of filenames)

SRU defaults to the standard CLIPPER/dBASE file type '.PRG', but you may
specify any file type. (I don't think you'll have much luck with anything
other than an ascii file so please don't specify *.OBJ if you have .OBJ
files in the default directory).

When the directory of files is displayed in the middle window, you may
select any 'single' file to be searched by scrolling to the filename and
pressing ENTER. Pressing ESCape will select all files with a matching

You may use a full filename in place of a skeleton such as '*.PRG'.

PROMPTING - (should be set to OFF for maximum performance)

Select PROMPT OFF if you want SRU to automatically rip thru all the files
selected. Pressing the ESCape key will abort 'search and replace' after
the current file is closed.

SRU defaults to PROMPT=ON. This will allow you to verify the file name
before execution begins. If you answer 'NO' when prompted, the current
file name is skipped and you are prompted again with a new filename.

Prompting can be toggled to OFF at any time, this will allow SRU to go
through all the selected files and perform the replace whenever the
search string is found. If prompting is on, you can abort back to the
main menu by pressing ESCape.

GREP - (Should be set to OFF for maximum performance)
(Set to ON if you don't want to replace every occurance)

This mode is used if you want SRU to display the search string if located
within the current search file. If you don't want to change every
occurance of the search string, then this is the mode to use.

If you set GREP to 'ON', SRU will scroll each line of the selected file
until it finds a match for the 'search string'. When a match is found,
you have 3 options:

1. Press 'R' to replace the string and continue to the next match.

2. Press 'I' to ignore this string and continue to the next match.

3. Press 'Q' to quit searching the current file.

If you do decide to 'quit' the file, SRU will continue thru the
current file, but no lines are displayed and no more changes are

* See the NOTE on GREP below.

DIRECTORY - (Use to select a new Filename)

Reloads the directory with the current filespec (*.PRG or whatever) and
allows you to select one or all files to be searched.


The string to 'search' for. The search string is not limited to one word.
That is, it may contain multiple words or text. If you want leading or
trailing spaces, use the ^ (shift 6) symbol in place of the space or
spaces. The string length is 1-60 characters. DO NOT put the
text within quotation marks unless the quotation marks are part of the
string you are searching for.


The string to replace the 'search' string with. If it is to contain
leading or trailing spaces, be sure to use the ^ (shift 6) symbol in
place of the space(s). DO NOT USE the ^ symbol in the middle of the
string to signify a space. The string length is 1-60 characters.
DO NOT put this string in quotation marks, unless you want the
quotation marks to appear along with the replacement string.


Executes the search and replace on the selected file(s).

If you have PROMPT=OFF then all files with a matching extension
are automatically searched and any matches found will be replaced
with the 'replace' string.

If you have PROMPT=ON then you will be prompted with the filenames
that contain the 'search' string. At that time you may skip the
current file, or do the replace.

EXECUTE is not available when there is no search string or no
replace string.



IBM PC-XT, AT or compatible.

SRU loads large files in 16K chunks so memory should not be a problem.



SRU is written in CLIPPER, and uses some FUNCKY.LIB functions.

The F1 Key 'Help' simply displays this SRU.DOC file.

There is no context sensitive help here.

GREP versus non-GREP mode:

SRU will handle your files with either of 2 methods:

Method 1: "NON-GREP". The fastest mode.

If GREP is not selected, the search file is handled as
a single string (unless it is larger than 16K in which
case it is loaded into memory in 16K chunks). String
manipulation is fairly quick, and all matching patterns
can be modified with the least amount of effort.

Method 2: "GREP". The slowest mode.

In GREP mode the search file is not handled as a
string, but as a file. This means that each line in the
search file must be read into memory a line at a time.
The new line (modified or not) must then be written out
to a disk file. Although visually this method appears
to be running fairly fast (depends on system type), file
manipulation is somewhat slow. In addition, if you 'Quit'
while searching a file, SRU must continue to copy the
remainder of the file to the new file before actually

NON-GREP mode is fastest and easiest.

GREP mode will always ask you whether or not to search the current
file. This allows a momentary halt at which you may abort execution.


Use and enjoy! SRU has saved me alot of time. Time I used to spend
inside a word processor loading one file after another. I hope that you
find it equally useful.


Please notify me if you have any questions, comments, or recommendations
for the program:

DAN FUGITT / Telcom Services
(214) 416-9221

* GREP is probably a registered trademark of Borland.

 December 23, 2017  Add comments

Leave a Reply