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.
it can find files which are included in one specified directories,
but not included in the remaining directory.
- Shell script for Unix/Linux:
Batch file for Windows: difflc.bat
- Jar file (common for Unix and Windows): DiffLineCounter.jar
Ver. 2.0 (63KB)
- This tool requires Apache Commons CLI, commons-cli-1.2.jar
(available on http://commons.apache.org/cli/download_cli.cgi)
How to install
- Put DiffLineCounter.jar and commons-cli-1.2.jar in
- 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 "=".
(NG: DIFF_LINE_COUNTER = "/home/aman/bin/DiffLineCounter.jar")
difflc [option] [target_A target_B]
- -a : all files are listed even if they are not included in both
target_A and target_B (when target_A and target_B are directories).
If a file is included in target_B but not in target_A,
its total number of changed lines is reported as -1. (case of file addition)
If a file is included in target_A but not in target_B,
its total number of changed lines is reported as -2. (case of file deletion)
- -c : CUI (console) mode.
Both target_A and target_B must be specified in this mode.
- -d opt : options to be specified to the "diff" command execution
- -e ext : file extentions to be checked.
Two or more extentions can be specified like "c,cpp,h,java".
- -o out : output file. (default: standard output)
- -z : the same files are also reported as
the total number of changed lines = 0.
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