Text Search and Replace Utility


Topics:

Overview
Usage


Overview

The text search and replace utility is a console-based program used to search for, insert, and replace strings in text files.


Usage

You can pass one of several switches to the program from the command line to perform any one of the available operations. From the command line you can use a wildcard to specify a group of files, for example: *.txt would process all files in the current directory that have a .txt extension. For a list of switches, execute the program with no arguments.

ffind program version 4000.101
Usage: ffind [switches] iofile.txt
Switches:
          -a = Do not append lines connected by a backslash
          -c = Concatenate file to stdout.
          -f = Find first occurrence of specified string: -f"string"
          -F = Find all occurrences of specified string: -F"string"
          -i = Perform case insensitive compare.

          -R -W = Replace all occurrences of a string in a file.
          Usage: -R"string" -W"replacement"

          -L -W = Replace entire line after the specifed string.
          Usage: -L"string" -W"replacement"

          -I -W = Insert a line after the specifed string.
          Usage: -I"string" -W"insert"

The "-a" switch will cause each line of a long line of text connected by a series of backslashes to be treated as a single line.

The "-c" switch is used print a text file to the console.

The "-f" switch is used to find the first occurrence of the specified string on each line of the file.

The "-F" switch is used to find all occurrences of the specified string in the text file. At the completion of the find operation the total number of strings found will be passed to the operating system.

The "-i" switch is used to perform a case-insensitive comparison during a search or replacement operation.

The "-R -W" switches are used to replace all occurrences of a string in a text file. The -R switch specifies the string that will be replaced. The -W switch specifies the string to insert in place of the string specified by the -R switch. At the completion of the replace operation the total number of strings replaced will be passed to the operating system.

The "-L -W" switches are used to replace a line of text after the specified string. The -L switch specifies the point were the line will be truncated. The -W switch specifies the line of text to insert after the string specified by the -L switch. At the completion of the line replace operation the total number of lines inserted will be passed to the operating system.

The "-I -W" switches are used to insert a string after the specified string. The -I switch specifies the point were the new string will be inserted. The -W switch specifies the string to insert after the string specified by the -I switch. At the completion of the insert operation the total number of string inserted will be passed to the operating system.


End Of Document