Beyond Compare 3 - automation of several files comparison

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chaveex
    Journeyman
    • Oct 2014
    • 11

    Beyond Compare 3 - automation of several files comparison

    Hello everyone,


    First, I would like to thank you for the work done on Beyond Compare which rocks !

    I have a problem and here is a context. My job is to compare with Beyond Compare, some .txt files from two distincts environments, and I have to specify my own matching keys for each files couple.
    The problem is that I have hundred files to compare, I waste a lot of time doing it one by one.
    So, I decided to try to run any scripts which would permit me to run Beyond Compare with the following settings :


    bcscript.txt
    Code:
    log verbose append:"C:\Users\xxxx\yyyyyy\POCBeyondCompare\logs\logtest.txt"
    beep
    load "%1" "%2"
    expand all
    select all
    data-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:"%3" output-options:wrap-word,html-custom="../styles.css"
    and here is the batch script run_compare.bat


    Code:
    "C:\\xxxxxxxx\\Scooter Software\\Beyond Compare\\bcompare.exe" "@C:\\Users\\xxxxxx\\yyyyyy\\POCBeyondCompare\\bcscript.txt" "C:\\Users\\xxxxxx\\yyyyyy\\POCBeyondCompare\\A" "C:\\Users\\xxxxxx\\yyyyyy\\POCBeyondCompare\\B" "C:\\xxxxxx\\yyyyyy\\Documents\\POCBeyondCompare\\Results\\bcreport_2209.html"
    I met my first problem, It seems that I cannot set matching keys from a script. Then, I have looked on Scooter forum and I found that I can modify these keys in the BCSessions.xml in the following tag :
    HTML Code:
    <Keys Value="2;3;7" />
    Therefore, I began to develop a tool that permit to generate a BCSessions.xml with settings set in an Excel file, and finally I got this xml :


    BCSessions.xml generated :

    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <BCSessions>
        <TSessionFolder>
            <Items>
                <TDataCompareSession Value="file1.txt and file2.txt">
                    <Rules>
                        <Cols>
                            <Keys Value="2;4;8;10"/>
                        </Cols>
                    </Rules>
                    <Specs>
                        <Left Value="C:/Users/981210/Documents/POCBeyondCompare/A/file1.txt"/>
                        <Right Value="C:/Users/981210/Documents/POCBeyondCompare/B/file2.txt"/>
                    </Specs>
                    <State>
                        <DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
                    </State>
                </TDataCompareSession>
                <TDataCompareSession Value="monfichier1 and monfichier2">
                    <Rules>
                        <Cols>
                            <Keys Value="2;4;8;11"/>
                        </Cols>
                    </Rules>
                    <Specs>
                        <Left Value="C:/Users/981210/Documents/POCBeyondCompare/A/file3.txt"/>
                        <Right Value="C:/Users/981210/Documents/POCBeyondCompare/B/file4.txt"/>
                    </Specs>
                    <State>
                        <DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
                    </State>
                </TDataCompareSession>
                <TDataCompareSession Value="file5.txt and file6.txt">
                    <Rules>
                        <Cols>
                            <Keys Value="2;4;8;12"/>
                        </Cols>
                    </Rules>
                    <Specs>
                        <Left Value="C:/Users/981210/Documents/POCBeyondCompare/A/file5.txt"/>
                        <Right Value="C:/Users/981210/Documents/POCBeyondCompare/B/file6.txt"/>
                    </Specs>
                    <State>
                        <DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
                    </State>
                </TDataCompareSession>
            </Items>
        </TSessionFolder>
    </BCSessions>
    Once generated, I put this BCSessions.xml into the Beyond Compare AppDate directory, but when I run BC, it does not considerate my xml...

    I begin to lose hope, is there a solution for my problem ?
    (A little reminder for this long thread, the problem : I would like to automate multi files .txt comparison and defining my own matching keys)

    Thanks !

    Chaveex
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Thanks for the translation into English, but I already used Google Translate and answered in the French forum, here:
    http://www.scootersoftware.com/vbull...(Data-Compare)
    Aaron P Scooter Software

    Comment

    Working...