Skip to content

Compares two or more files to determine whether they are equal or not (through terminal, see further info README)

Notifications You must be signed in to change notification settings

toderesa97/File-comparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

micmp

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:

  1. Compare two files and retrieve whether they're equal or not.
  2. Compare two files from different shifts.
  3. 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)

Syntax (Basic cases)

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)

(1)

./<desired_name> file1.txt file2.txt

cmp_basic

(2)

./<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)

cmp_i

(3)

./<desired_name> -l file1.txt file2.txt

cmp_l

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."

modified to ...

"...tools and technologies that allow researchers to study cells and their -DNA."

./<desired_name> -l file1.txt file2.txt

cmp_l2

Composed cases.

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:

  1. 1131
  2. 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.

About

Compares two or more files to determine whether they are equal or not (through terminal, see further info README)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages