Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

How to compare content of files using fc command

I was having issues with comparison of two large csv files that I came across fc comparision command of Microsoft DOS. fc  is a command line program that compares multiple files and outputs the differences between them


The syntax of fc Command and results of execution of fc with different arguments is shown below:




Syntax for fc command:


fc filename1 filename 2 [Parameter for comparision type] >Log File Path

where filename1 and filename2 are paths of the two files to be compared .
LogFilePath is path for saving result log
Commonly used Parameters are as described below:
/a :  fc displays only the first and last line for each set of differences.
/b : Compares the files in binary mode.
/c : Ignores the case of letters.
/l :  Fc compares the two files line by line and attempts to resynchronize the files after finding a mismatch. 
/lbn : Sets the n number of lines for the internal line buffer.
/n : Displays the line numbers during an ASCII comparison.

No comments:

Post a Comment