I still use Windows XP Professional SP3, as you may have gathered if you’ve read some of my previous posts. I came across this little nugget in the Help and Support documentation (always a nice place to fool around in if you are a bit bored). The command line comp utility let’s you do a comparison of the contents of (a) two different files which may be in different directories or (b) two different sets of files on a byte-by-byte basis.
As per Microsoft’s Help and Support Center documentation the syntax of the command is:
comp [data1] [data2] [/d] [/a] [/l] [/n=number] [/c]
As per the same documentation the parameters are described as:
“
data1
Specifies the location and name of the first file or set of files you want to compare. You can use wildcard characters (* and ?) to specify multiple files.
data2
Specifies the location and name of the second file or set of files you want to compare. You can use wildcard characters (* and ?) to specify multiple files.
/d
Displays differences in decimal format. (The default format is hexadecimal.)
/a
Displays differences as characters.
/l
Displays the number of the line on which a difference occurs, instead of displaying the byte offset.
/n=number
Compares the first number of lines of both files, even if the files are different sizes.
/c
Performs a comparison that is not case-sensitive.
/?
Displays help at the command prompt.
“
One important point to remember is that the utility does allow you to compare files of different sizes but then you have to specify the number of lines in the files to be compared. The comp utility will not allow you to fully compare a 5kB file with a 55kB file, which makes sense because you’ve already solved part of the question by just viewing the file sizes.
21 June 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment