Skip to content

How to run CSVComparer

Jonathan Scott edited this page Sep 7, 2020 · 6 revisions

The program takes 3 command line arguments

CSVComparer.exe [Path to Reference CSV File] [Path to Candidate CSV File] [Path to Configuration XML] [Optional Path to output results file]

The configuration XML defines the behaviour of the CSV comparison, for example, what the separator character is, which columns define the unique key for a row, how to handle numeric differences and so on:

<?xml version="1.0" encoding="utf-8"?>
<ComparisonDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Delimiter>,</Delimiter>
  <KeyColumns>
    <Column>ABC</Column>
    <Column>DEF</Column>
  </KeyColumns>
  <HeaderRowIndex>0</HeaderRowIndex>
  <ToleranceValue>0.1</ToleranceValue>
  <ToleranceType>Relative</ToleranceType>
</ComparisonDefinition>

Example files you can use to run are included as ReferenceFile.csv, TargetFile.csv and Configuation.xml

If you supply a directory instead of an explicit Reference or Candidate file then a directory comparison will be performed.

Clone this wiki locally