Announcement

Collapse
No announcement yet.

Comparison of 2 CSV files - differing paths and names

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

  • Comparison of 2 CSV files - differing paths and names

    Hello,

    I've tried searching a bit and have looked through the manual, but I can't seem to figure this out, so pardon me if this is a redundant question.

    I am trying to compare two files which may not be in the same location, nor have the same exact name. To do this, I have been using a simple script to gather the paths and file names, then feeding them into BC2 as arguments.

    So far, no matter whether I load the base path first or not, I get an error stating that I have incorrect parameters (see below). Any ideas on what I am doing wrong?

    Script:
    Code:
    log "\\X\Mason - Kathy\log.txt"
    file-report layout:patch &
    options:patch-standard &
    output-to:%3 %1 %2
    Command:
    Code:
    "C:\PROGRA~1\SCOOTE~1.1\BC2.exe @"\\Y\bc_script.txt" "\\X\Kathy ULSD Revision Reporting - ver 1.csv" "\\X\Mason - Kathy\Kathy ULSD Revision Reporting - ver 2.csv" "C:\diffResult.txt"
    Log File:
    Code:
    4/28/2009 11:27:50 AM  >> log "\\X\My Documents\Projects\Mason - Kathy\log.txt"
    4/28/2009 11:27:50 AM  >> file-report layout:patch &
    4/28/2009 11:27:50 AM  >> options:patch-standard &
    4/28/2009 11:27:50 AM  >> output-to:C:\diffResult.txt "\\X\Mason - Kathy\Kathy ULSD Revision Reporting - ver 1.csv" "\\X\Mason - Kathy\Kathy ULSD Revision Reporting - ver 2.csv"
    4/28/2009 11:27:50 AM  Script Error: Incorrect parameters
    Using BC2 Version 2.3.1
    Last edited by jsziegler; 28-Apr-2009, 03:43 PM. Reason: Appended my version of BC2 to the problem info.

  • #2
    It looks like you do not have a third parameter. %1, %2, and %3 refer the the parameters as presented after the @script parameter.

    BC2.exe @script.txt file1 file2 OutputFileHere.txt

    The Command code you provided does not seem to have the OutputFileHere.txt (which would be %3 in your script, and is where the report is generated (either .txt or .html, depending on how you want to setup your report).

    Does including a simple \\x\folder\output.txt help get your script running?
    Aaron P Scooter Software

    Comment


    • #3
      That was a copy-and-paste error, I looked and verified that I do have the third argument. I have updated the original post's command to represent this. I also appended the exact version number that I am using in case that might give you insight.

      Anything else that I can try?

      Comment


      • #4
        All BC2.x updates are free for BC2 licensed users. Please update to the newest release to see if this is an already addressed issue. You can download the update here:
        http://www.scootersoftware.com/download.php?zz=dl2_en

        Is "\\X\My Documents" the exact text of the script? Is 'X' the name of a shared computer?

        Side Note:
        You can also install the trial of BC3, which does not interfere with your BC2 install. By default it installs to a separate directory.
        http://www.scootersoftware.com/download.php
        Aaron P Scooter Software

        Comment


        • #5
          1. I updated to 2.5 but it reproduced the same error after changing which exe I was using to the new one.

          2. X simply denotes a set of folders residing on a server I'm using. Since their names don't matter, I reduced it all down to X for anonymity and easier reading. I've included a better look at what the actual string looks like below in the newest log.

          3. I went ahead and installed a trial version of BC3 which gave me a slightly more specific error message. I'm still not getting any messages on the error tab and adding the verbose option didn't seem to work.

          Code:
          4/29/2009 8:38:51 AM  *** Beyond Compare 3 Evaluation -- 30 days remaining ***
          4/29/2009 8:38:51 AM  >> log verbose "\\SVR.DOMAIN.COM\USERNAME\My Documents\Projects\NAME\log.txt"
          4/29/2009 8:38:51 AM  >> file-report layout:patch &
          4/29/2009 8:38:51 AM  >> options:patch-standard &
          4/29/2009 8:38:51 AM  >> output-to:C:\diffResult.txt &
          4/29/2009 8:38:51 AM  >> \\SVR.DOMAIN.COM\USERNAME\My Documents\Projects\NAME\Kathy ULSD Revision Reporting - ver 1.csv \\SVR.DOMAIN.COM\USERNAME\My Documents\Projects\NAME\Kathy ULSD Revision Reporting - ver 2.csv
          4/29/2009 8:38:51 AM  Fatal Scripting Error: Unable to create report: Error Opening File
          4/29/2009 8:38:53 AM  Script completed in 1.69 seconds
          The application is running under my permissions (admin on WinXP), so it should have rights to open and/or create files as needed. I'm wondering if it's not interpreting the paths in quotations correctly. Ideas?
          Last edited by jsziegler; 29-Apr-2009, 02:10 PM. Reason: Removed previous post quote.

          Comment


          • #6
            Problem Solved

            Okay, I think I have my problem solved. Here is what I did just for anyone who comes after me with this problem:

            1. Within my BC script, I didn't have double quotes around the variables (%2 instead of "%2"). I thought that I was providing those quotes via the VB script I was using, but those quotes were being "stripped" by the command line, so it knew that it was a single argument. When it was finally passed to BC, the path was without quotes and thus failed.

            2. After fixing that, I got an error saying that the optional standard-patch argument was invalid/incorrect. I looked and since this option is assumed, you apparently can't declare it explicitly.

            3. Updated to BC3. When trying to revert back to either of the BC2 installs I have, it gives me an incorrect parameter error. Not really sure why, but at this point I'm not too interested in finding out.

            Thanks for your help Aaron.
            Last edited by jsziegler; 29-Apr-2009, 03:07 PM. Reason: Spelling and ambiguous terminology changes.

            Comment


            • #7
              Hello,

              Ahh, that makes sense. The quotes around "%2" parameters can easily be a cause in some cases like this. To test this in the future, it is often good to run bcompare manually from the command line. That helps determine if it is a script issue or parameter issue.

              Though, your BC3 trial install and BC2 installs should be completely independent. BC3 installs to a separate folder and does not interact with BC2. You can install both independently, and register or trial them independently. You shouldn't need to 'revert' back, since you can have both installed at the same time, each with its own stored settings. If you wish to troubleshoot this at all, please let us know. Otherwise, I would recommend continuing with BC3 and let us know if you have any trouble setting it up.
              Aaron P Scooter Software

              Comment


              • #8
                Originally posted by Aaron View Post
                ... BC3 installs to a separate folder and does not interact with BC2. You can install both independently, and register or trial them independently. You shouldn't need to 'revert' back, since you can have both installed at the same time, each with its own stored settings...
                I should be careful with my wording, I actually meant that I was swapping out the new executable path with the old one to see if it would still work, which it didn't. I never actually uninstalled anything.

                Thanks for all of your help.

                Comment


                • #9
                  One Answer and More Questions

                  One more note for historical purposes:

                  I got the script to work in BC2, but I had to change the script file to the following:
                  Code:
                  log verbose "\\X\Projects\User\log.txt"
                  file-report layout:patch &
                  output-to:%3 &
                  %1 %2
                  If you notice, the quotes are not included with this one which is the opposite of what BC3 requires.

                  One more question:

                  The diff output for the patch-standard (which is the assumed patch output according to both versions) differs from BC2 to BC3, with BC2 being incorrect... so why is that? If I go into the actual GUI and run the same files using the patch-standard (labeled "Normal Diff" within the GUI) it comes out fine. Any ideas?

                  Ex. BC2 (Ver. 2.3.1 & 2.5.3)
                  Code:
                  --- \\X\Projects\User\Excel Comparison Tool\Temp\oldFileCopy.csv	2009-05-05 09:49:21.000000000 -0400
                  +++ \\x\Projects\User\Excel Comparison Tool\Temp\newFileCopy.csv	2009-05-05 09:49:21.000000000 -0400
                  @@ -8,20 +8,21 @@
                   ##REPORT FORM ID,REPORT TYPE,CBI,REPORT DATE,REPORT YEAR,COMPANY ID,FACILITY ID,PERIOD CODE,TYPE,ENTITY ID,FACILITY ID,    STATUS,  (GALLONS),   (GALLONS),     (GALLONS),     (GALLONS),     (GALLONS),     (GALLONS),     (GALLONS),     (GALLONS),     (GALLONS),     (GALLONS),     (GALLONS)
                   DSF0501,O,Y,4/15/2009,2009,4268,81111,Q3,RX,4564,82001,FUN,419958,10421166,0,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81111,Q3,RX,8260,81061,FUN,0,1886094,0,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81112,Q3,RX,4518,82072,FUN,0,1007580,0,0,0,0,0,3071418,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81112,Q3,RX,4525,82164,FUN,0,12053370,0,0,0,0,0,207732,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81113,Q3,RX,4518,82072,FUN,0,550326,0,0,0,0,0,0,0,0,0
                  +DSF0501,O,Y,4/15/2009,2009,4267,81113,Q3,RX,4525,82164,FUN,0,9758406,0,2,0,0,0,3922758,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81113,Q3,RX,4525,82164,FUN,0,9758406,0,0,0,0,0,3922758,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81114,Q3,RX,4518,82073,FUN,0,14952756,0,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81115,Q3,RX,4564,82001,FUN,422058,10780224,0,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81116,Q3,RX,4036,82869,FUN,0,0,312166,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81116,Q3,RX,4267,82070,FUN,2561160,25962342,0,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81116,Q3,RX,4268,81162,FUN,0,0,432646,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81117,Q3,RX,4268,81162,FUN,0,10385218,0,0,0,0,0,0,0,0,0
                  -DSF0501,O,Y,4/15/2009,2009,4268,81118,Q3,RX,4518,82072,FUN,0,9483054,0,0,0,0,0,0,0,0,0
                  +DSF0501,O,Y,4/15/2009,2009,4268,81118,Q3,RX,4518,82072,FUN,0,9483054,0,2,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81118,Q3,RX,4525,82164,FUN,0,4090464,0,0,0,0,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81119,Q3,RX,ERR,ERR,TDM,0,0,0,0,0,0,0,2258718,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81119,Q3,RX,4518,82073,TDM,0,0,0,0,0,0,0,794136,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81119,Q3,TX,ERR,ERR,FUN,0,0,0,0,0,849,0,0,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81119,Q3,TX,ERR,ERR,TDM,0,0,0,0,0,0,0,2249163,0,0,0
                   DSF0501,O,Y,4/15/2009,2009,4268,81120,Q3,RX,4268,81162,FUN,1663777,10845227,0,0,0,0,0,0,0,0,0
                  @@ -200,9 +201,8 @@
                   DSF0501,R,Y,4/15/2009,2009,4268,81138,Q2,RX,4564,82001,FUN,0,10771110,0,0,0,0,0,0,0,0,0
                   DSF0501,R,Y,4/15/2009,2009,4268,81138,Q2,TX,4564,82001,FUN,3149538,3360126,0,0,0,0,0,0,0,0,0
                   DSF0501,R,Y,4/15/2009,2009,4268,81138,Q2,TX,4572,82321,FUN,0,10713108,0,0,0,0,0,0,0,0,0
                   DSF0501,R,Y,4/15/2009,2009,4268,81148,Q2,RX,4006,81617,FUN,0,2023014,0,0,0,0,0,0,0,0,0
                   DSF0501,R,Y,4/15/2009,2009,4268,81148,Q2,RX,4518,82073,FUN,0,19620174,0,0,0,0,0,0,0,0,0
                   DSF0501,R,Y,4/15/2009,2009,4268,81155,Q2,RX,4519,82077,FUN,864990,19924002,0,0,0,0,0,0,0,0,0
                  -DSF0501,R,Y,4/15/2009,2009,4268,81155,Q2,TX,ERR,ERR,TDM,7141,363,0,0,0,0,0,0,0,0,0
                   DSF0501,R,Y,4/15/2009,2009,4268,81157,Q2,RX,ERR,ERR,FUN,0,21210,0,0,0,0,0,0,0,0,0
                   DSF0501,R,Y,4/15/2009,2009,4268,81157,Q2,RX,4267,82050,FUN,1589910,21421092,0,0,0,0,0,0,0,0,0
                  Ex. BC3
                  Code:
                  Left file: \\X\Projects\User\Excel Comparison Tool\Temp\oldFileCopy.csv
                  Right file: \\X\Projects\User\Excel Comparison Tool\Temp\newFileCopy.csv
                  13a14
                  > DSF0501,O,Y,4/15/2009,2009,4267,81113,Q3,RX,4525,82164,FUN,0,9758406,0,2,0,0,0,3922758,0,0,0
                  21c22
                  < DSF0501,O,Y,4/15/2009,2009,4268,81118,Q3,RX,4518,82072,FUN,0,9483054,0,0,0,0,0,0,0,0,0
                  ---
                  > DSF0501,O,Y,4/15/2009,2009,4268,81118,Q3,RX,4518,82072,FUN,0,9483054,0,2,0,0,0,0,0,0,0
                  206d206
                  < DSF0501,R,Y,4/15/2009,2009,4268,81155,Q2,TX,ERR,ERR,TDM,7141,363,0,0,0,0,0,0,0,0,0

                  Comment

                  Working...
                  X