Top > Research > Tools > DiffLineCounter

DiffLineCounter

Summay

DiffLineCounter counts up the number of lines which are different between specified two files, by using Unix command "diff."
It also works for directories. If directories are specified, DiffLineCounter compares pairs of files which have the same relative path names in the specified directories. Moreover, it can find files which are included in one specified directories, but not included in the remaining directory.

Download

How to install

  1. Put DiffLineCounter.jar and commons-cli-1.2.jar in a directory.
  2. Describe the absolute pathes of DiffLineCounter.jar and commons-cli-1.2.jar to DIFF_LINE_COUNTER and CLI in difflc (or difflc.bat), respectively.

    Don't insert any blank around "=".
    (OK: DIFF_LINE_COUNTER="/home/aman/bin/DiffLineCounter.jar")
    (NG: DIFF_LINE_COUNTER = "/home/aman/bin/DiffLineCounter.jar")

Usage

  difflc [option] [target_A target_B]  

options

Output format

file_name,path_in_target_A,path_in_target_B,total number of changed lines,number of added lines,number of deleted lines,number of modified lines

Note: the number of modified lines is the larger count of corresponding modified parts between target_A and target_B.
The total number of changed lines = number of added lines + number of deleted lines + number of modified liens.

DiffLineCounter might throw a run time error when it's run on Linux and the end of line characters of target files are CR+LR.

(C) Copyright 2001 - 2011 Hirohisa AMAN