C application for replacing strings within a file
This is a C language application for replacing strings within a file, using a simple command line utility called "replace",
ex: replace OPT <from> <to> -- <filename> [<filename>]*
where OPT can be zero or more of -b, -f, -l, -i
-
0: if specified, the replace utility performs the search for string from in a case sensitive way.
-
-b: if specified, the replace utility creates a backup copy of each file on which a replace operation is performed before modifying it.
-
-f: if specified, the replace utility only replaces the first occurrence of string from in each file.
-
-l: if specified, the replace utility only replaces the last occurrence of string from in each file.
-
-i: if specified, the replace utility performs the search for string from in a case insensitive way.
-
from: string to be replaced with string to.
-
to: string that will replace string from.
-
filename: the file(s) on which the replace operation has to be performed.
Netbeans IDE with c/c++ compiler (GCC)
1- Download the zip file, and unzip it.
2- Open the Netbeans (IDE).
3- File -> Open Project, then select the project (C application for replacing strings within a file).
4- Run -> Clean and Build Project (Shift + F11).
5- create files with data in it to replace and put it in the same directory of main.c
6- run it
You can input in form : replace OPT -- []*
replace -i Howdy Hello -- file1.txt file2.txt file3.txt
replace -b -f Bill William -- file1.txt file2.txt
replace -f -l abc ABC -- file1.txt
version 1.0.
- Amr Tarek Hassan - web site - AmrTarek