Personal Revision Control System


Index · 
Overview · 
Design · 
Using · 
Faq · 
Download · 
Developers · 
 

Interpretation of Difference Objects provided by JLibbDiff



Basically JLibbDiff gives the difference between two text files in terms of 3 different type of operations described below.
1) Deletion
2) Addition
3) Change
1>Deletion : Format : X,Y(optional) d Z



(X,Y,Z are integers representing line numbers in the files)
d ------------ Indicates delete operation
X ------------ Deleted From line number(X) in the 1st File
Y ------------ To line number(Y) in the 1st File. Its an optional parameter
Z ------------ After line number(Z) in the 2nd File
example :


3,5 d 2
This specifies that line number 3 to 5 of first file are missing in the second file(after line 2).
4 d 5
This specifies that ONLY line number 4 of first file is missing in second file after line 5.
2>Addition : Format : X a Y,Z(optional)

(X,Y,Z are integers representing line numbers in the files)
a ------------ Indicates addition operation
It indicates that line number from Y-Z are being added in the second file which are not present after line number X in the first file.
Parameter Z of the second file is optional.
example :


2 a 3,5
This specifies that line number 3 to 5 of second file are additional lines which were not there after line number 2 in the first file.
4 a 5
This specifies that ONLY line number 5 is added in second file after line 4 in the first file.
3> Change : Format W,X(optional) c Y,Z(optional)

(W,X,Y,Z are integers representing line numbers in the files)
Indicates that line number from W-X in the first file have been changed by line number Y-Z in the second file.
example


2,5 c 3,6
This specifies that line number 2 to 5 of the first file have been replaced by line number 3 to 6 of the second file.
3 c 4,7
This specifies that line number 3 of the first file have been replaced by line number 4 to 7 of the second file.

So the output of JLibDiff will be a combination of these 3 types of operation described above.
For eg:


Consider 2 files FILE1.txt & FILE2.txt
Contents of FILE1.txt

What
is
your
name
How
are
U
I am fine
Contents of FILE2.txt

What
is
name
I am added here
How
are ya i am changed
U me too changed
I am fine
When this 2 files are given input to VDiff.VDiff File1.txt File2.txt
OUTPUT is:
delete 3d2
< your
Add 4a4
> I am added here
change 6,7c6,7
< are
< U

> are ya i am changed
> U me too changed
closing file

Back On Top
Do You Feel this project is worth enough to put your efforts in ? then visit us at
SourceForge.