This program compares two or more files to determine whether they are equal or not. The program is made in C and it's ideal for terminal use. The program has three variations:
- Compare two files and retrieve whether they're equal or not.
- Compare two files from different shifts.
- Compare two files showing in a table the differences between the files (ASCII)
More than one functionality could be executed just in a statement. (ie, you could execute 1,1,2,3,1)
First of all what we need it's to compile micmp.c, type in terminal in the correspondent directory where the file is located.
gcc micmp.c -o <desired_name>
Once compiled, you can choose executing the different options: (suppose we've created two files : file1.txt and file2.txt, you can download them from this project)
./<desired_name> file1.txt file2.txt
./<desired_name> -i X:Y file1.txt file2.txt
Where X and Y represent a shift (ie, program will start comparing file1 from position X and file2 from Y till the end)
./<desired_name> -l file1.txt file2.txt
Output when two files are different... (modifying the last line of file1.txt)
"...tools and technologies that allow researchers to study cells and their DNA."
"...tools and technologies that allow researchers to study cells and their -DNA."
./<desired_name> -l file1.txt file2.txt
As it was told at the beginning you can execute in one statement more than one comparison, even using different variations. In other words, what about if I want to see if two files are the same, whether they are the same with different shifts and show , between two files, the differences in a table; all this in one line...? as follows: (any file could be used)
./<desired_name> my_wage.txt uni -l another.txt file.txt -i 4:45 hello file1.txt
Note that variation 132 is being used. Other examples of variations may be:
- 1131
- 33113
If more than one variation is executed program will split and show them in the terminal properly sorted using the tag pad (#) followed by an autoincrement_id (which starts in 1), then the statement to be executed and finally the result.
That's all. Regards,
Toderesa97.