string1 file1 string2 file2
where file1 and file2 are file names and string1 and string2 are C strings.
It makes a copy of the content of file1 (input file) in file2 (output file) substituting each sequence of characters equal to string1 with string2.
##Notice that:
- file1 contains an unknown number of rows, but each row is at most of length equal to 100 characters
- string1, string2 and all C strings in file1 have a maximum length equal to 20 characters
- string1 and string2 are proper C strings, i.e., they to not contain spaces, tabs, etc.
##Example Let us suppose to run the program with the following parameters:
test file1.txt check file2.txt
and that file1.txt is the following:
####Regression file.
This file is to test the program.
In the previous line we should have a substitution (testWITHcheck).
Here we should not have it: t-e-s-t.
The following file2.txt has to be generated:
####Regression file.
This file is to check the program.
In the previous line we should have a substitution (checkWITHcheck).
Here we should not have it: t-e-s-t.
Suggestion Use the program to substitute a sub-string within a string
as a subprogram.