File Compare (fc)


File Compare (fc) \ windows \system32\fc.exe

File Compare ( fc.exe ) compares the contents of two files (or more, using wildcards), and displays the differences (if any). If the files are identical, fc.exe will report FC: no differences encountered . If the files are different, fc.exe lists the differing lines. To compare two files, type fc bill.txt marty.txt . The output will look something like this:

 Comparing files Bill.txt and Marty.txt ***** Bill.txt Way down Louisiana close to New Orleans Way back up in the woods among the evergreens There stood a log cabin made of earth and wood ***** Marty.txt Way down Louisiana close to New Orleans Way back up in the woods among the antihistamines There stood a log cabin made of earth and wood ***** 

For each line or sequence of lines that is found to differ in the two files, fc.exe prints out a pair of excerpts from each file. The first and last line in each excerpt are what the two files have in common, and are included for context. The lines in between (only a single line in this example) show the differences. The syntax for fc.exe is as follows :

 fc   file1 file2   [/a] [/b] [/c] [/lb   n   ] [/n] [/t] [/w] [/off] [/   nnn   ] 

The options file1 , file2 , /c , and /off and are the same as those for File Compare (comp), discussed previously.

Option

Description

/a

Display only first and last lines for each set of differences, as opposed to the default of every different line.

/b

Treat the files as binary and perform the comparison on a byte-by-byte basis. Instead of the pairs of excerpts explained above, differing bytes are displayed in parallel columns . Unlike comp.exe , the other file comparison utility, the comparison will still be performed if they are different sizes. The /b option can't be used in conjunction with any of the other options.

/lb n

Limit the number of mismatches found to n (default is 100).

/n

Include line numbers in the report.

/t

Preserve any tabs in the files being compared.

/w

Compress tabs and spaces to a single space for comparison.

/ nnn

Specify the number of consecutive lines that must match after a mismatch. For example, if you type /4 , a mismatched line followed by 3 matching lines followed by one or more mismatched lines is treated as though it were a single sequence of mismatched lines.

/u

Treat the files as unicode text.



Windows XP Pocket Reference
Windows XP Pocket Reference
ISBN: 0596004257
EAN: 2147483647
Year: 2001
Pages: 154
Authors: David A. Karp

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net