Announcement

Collapse
No announcement yet.

Data Compare using command-line BComp.exe

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ddaiell
    started a topic Data Compare using command-line BComp.exe

    Data Compare using command-line BComp.exe

    We are trying to compare 2 Microsoft Excel .xls files using the C#.NET Beyond Compare utility wrapper (http://beyondcompare.codeplex.com/) for BeyondCompare v3.2.4. The C# code calls the following command and returns the DOS error level on exit:
    BComp.exe /quickcompare /ignoreunimportant filepath1.xls filepath2.xls

    This returns BinaryDifference (Error level 11), even though the data in the 2 excel files is the same.

    When running using the Beyond Compare GUI, we are able to get a successful match for the 2 files if we use the “Data Compare” setting. Is there a way to do the Data Compare through the command-line without displaying the user-interface?
    (We tried BComp.exe /fileviewer=”Data Compare” filepath1.xls filepath2.xls, but this causes our program to hang without returning the error level.)

    Thanks.

  • Aaron
    replied
    Also, is Excel installed on the machine running the comparison? Excel is required for the conversion process and for the rule to run, otherwise it will run as a binary comparison.

    Leave a comment:


  • Aaron
    replied
    Hello,

    In the graphical interface, the default rule used (which determines if a Data Compare or Text Compare is used) is in the Tools menu -> File Formats list. In this dialog, the topmost file format associated with *.xls is the rule used when you double click, or run a regular Rules-based comparison. Which file format is the topmost for you? Is it our default MS Excel with the gold Data Compare icon? If not, please move that format to the top (or uncheck the other installed Excel formats).

    When you then launch a new Data Compare session, then load your two files, do you have to make any changes in the interface to alter the comparison?

    Finally, try running the command line from the Command Prompt instead of the C# Helper first. This will help you determine if you have the proper command line setup. (/ignore unimportant is only used during merges and is not used here).

    bcomp.com /quickcompare "c:\filepath1.xls" "c:\filepath2.xls"
    Then check the %errorlevel% variable.

    Please note that the user contributed helper function you found is written for BC2. Near the bottom I notice that it only has 4 different cases when detecting the error level. You'll want to cover BC3's additional Dos Error Levels, documented in the Help file under the Command Line Reference section (at the bottom.) There may be other instances to fix in the code.

    Leave a comment:

Working...
X