How to compare two csv file with 1 unimportant column in command line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Simplify
    New User
    • Sep 2010
    • 2

    How to compare two csv file with 1 unimportant column in command line

    Hi all,

    Can someone to help me? I have tried to create command line comparision for two csv file, which should include one unimportant column.

    i have files 31_A.csv and 31_B.csv and I need to make command line comparision so that there will be one unimportant column called ValuePlain. Can someone help me?

    Cheers
    -Simplify
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    To compare two CSV files and ignore 1 column, you'll have to change the "Data Compare" session defaults to make the columns unimportant, then run a script to generate the comparison.

    Here's how:
    Open your CSV files interactively in Beyond Compare 3's Data Compare. Select "Session > Session Settings". Go to the "Columns" tab. Double click on a column you want to ignore. Check "Unimportant". Click OK. At the bottom of the Session Settings dialog, set the dropdown to "Also update session defaults", then click OK.

    Next, create a script:

    data-report layout:side-by-side options:ignore-unimportant output-to:c:\report.html output-options:html-color c:\file1.csv c:\file2.csv

    To run the above script, use the command line:
    bcompare.exe @c:\script.txt

    It isn't possible to define unimportant columns from a script in the current version of Beyond Compare.
    Chris K Scooter Software

    Comment

    • Simplify
      New User
      • Sep 2010
      • 2

      #3
      Thx for your answer. Very good.
      How about case that I need to run 2 different comparision in command-line, where in first have 1 unimportant field and in 2nd have 3 unimportant field?

      Cheers
      -KN

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        There isn't a good solution to compare files with different unimportant columns which need to be ignored from scripts. The only way to ignore columns from scripts is to change the default comparison settings while running Beyond Compare interactively. You would have to run BC interactively and change the default settings for each comparison.

        Setting column importance from a script is on our wish list for a future version, but until it is added changing the defaults interactively is the only way to ignore columns for scripts.
        Chris K Scooter Software

        Comment

        • Heena
          New User
          • Apr 2015
          • 1

          #5
          Hey Chris

          Is BC3 having option to define columns unimportant through the scripts ?

          Regards
          Heena







          Originally posted by Chris
          There isn't a good solution to compare files with different unimportant columns which need to be ignored from scripts. The only way to ignore columns from scripts is to change the default comparison settings while running Beyond Compare interactively. You would have to run BC interactively and change the default settings for each comparison.

          Setting column importance from a script is on our wish list for a future version, but until it is added changing the defaults interactively is the only way to ignore columns for scripts.

          Comment

          • Chris
            Team Scooter
            • Oct 2007
            • 5538

            #6
            Sorry, column importance for DATA-REPORT still cannot be defined in a script in Beyond Compare 3.3.13 or 4.0.7.

            Changing the default session settings in the GUI or loading a saved session created in the GUI is still the only way to mark a column unimportant for scripting.
            Chris K Scooter Software

            Comment

            • DaveJ
              New User
              • Jul 2018
              • 1

              #7
              Chris,

              Any updates/version on marking a column as unimportant through a script?

              Thanks

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16006

                #8
                Thanks. No updates yet for additional command line support. The workaround is to alter the BCSessions.xml before running the script call, update the default settings, and then run the script. To test different default settings, I would suggest altering them in the main graphical interface, which allows you to see how the settings work and how they are generating in the BCSessions.xml automatically.
                Aaron P Scooter Software

                Comment

                • rhayne04
                  New User
                  • Apr 2021
                  • 2

                  #9
                  I've made column 1 unimportant, and saved the setting as default using the GUI. But running with /qc still says there are differences.

                  C:\Users\rhayne04\Desktop>copy con x1.csv
                  1,2,3
                  2,3,4
                  3,4,5
                  ^Z
                  1 file(s) copied.

                  C:\Users\rhayne04\Desktop>copy con x2.csv
                  1,2,3
                  1,3,4
                  1,4,5
                  ^Z
                  1 file(s) copied.

                  C:\Users\rhayne04\Desktop>"C:\Program Files\Beyond Compare 4\bcomp.com" "x1.csv" "x2.csv" /fv="Table Compare" /iu /qc

                  C:\Users\rhayne04\Desktop>echo %errorlevel%
                  13

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 16006

                    #10
                    Hello,

                    Column 1 is often the Key column by default, which cannot be Unimportant. Instead of /qc, if you launch into the comparison by removing just /qc and calling the rest of the command line, what does it show?

                    If you are still having any trouble, please email into [email protected] with:
                    1) A pair of sample files
                    2) A full screen screenshot of what the comparison is showing when you launch from the command line above without /qc
                    3) Your BCSupport.zip from the Help menu -> Support, Export
                    4) a link back to this forum thread in the email

                    With this, we should be able to recreate your entire comparison and figure out what is going on.
                    Last edited by Aaron; 05-Apr-2021, 04:28 PM. Reason: Added 4) please include a link back to this thread
                    Aaron P Scooter Software

                    Comment

                    Working...