Skip to content

Gives the differences with line numbers for two text files

License

Notifications You must be signed in to change notification settings

ayushm-agrawal/Files-Diff-Compare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files-Diff-Compare

Gives the differences with line numbers for two text files

I got tired of continuously comparing my output by the sample output provided for any assignments, so I made this small program in Java that outputs any differences found between the two files.

#Compiling To compile this program, you can simply compile the program using javac diffComparer.java

#Running To run this program, there are two ways.

  • If you simply want the lines that are diffs, you can simply use the command java diffComparer <originalFile>.txt <yourFile>.txt
  • If you want to get deep diagnostics on what is different in the line, you can use the command java diffComparer -deep <originalFile>.txt <yourFile>.txt

#Output If you run the program with the files provided in the repository, you will see output like this. I have divided the sections so it is easy for you to pinpoint where the files don't match based on the line numbers.

----------------------DIFFS-------------------
 -----------------
| Line Number: 1 |
 -----------------
Your Output:

Virtual address: 16915 Physical address: 20 Value: 0
=============================================
Original Output:

Virtual address: 16916 Physical address: 20 Value: 0
=============================================

=============================================
 -----------------
| Line Number: 3 |
 -----------------
Your Output:

Virtual address: 30193 Physical address: 758 Value: 29
=============================================
Original Output:

Virtual address: 30198 Physical address: 758 Value: 29
=============================================

=============================================

About

Gives the differences with line numbers for two text files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages