Unable to ignore column in file.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prasadjs86
    Visitor
    • Jan 2017
    • 8

    Unable to ignore column in file.

    Hi,
    I am trying to compare tab delimited file. but in that file I want to ignore a one column named as 'LAST UPDATED DATE'(column no. 9).


    So I have tried to do it below given ways :
    1. Open Table Compare Session, click on Edit defaults, double click on column 9, Uncheck Use default checkbox, Check Unimportant & Click OK button. Then Click on Save As and Enter Name as "Test1234" and save it in <Root> folder.


    2. BeyondCompareScript file contains below code : (BeyondCompareScript.txt)
    criteria rules-based
    load "Test1234"
    load "%1" "%2"
    data-report layout:interleaved options:display-mismatches,line-numbers title:"Differences" output-to:%3"\Report\TextCompare.html" output-options:html-color

    3. To execute above script I am using below path :

    BCompare.exe "BeyondCompareScript.txt" "Folder Path of Folder 1" "Folder Path of Folder 2"

    It gives Error as "Loaded session must be folder compare"; it failes.

    Can you please help me to get this resolved.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    The issue is caused that the load command only accepts folder locations, while the session you edited was a file session. There are two main strategies for tackling this:

    -> Set as a global default
    From you description it sounds like you did this, and if you launch a new, blank Table Compare, that column is already Unimportant, correct?

    A small modification of your script would then be:
    load <default>
    criteria rules-based
    load "%1" "%2"
    expand all
    select diff.files
    data-report layout:interleaved options:display-mismatches,line-numbers title:"Differences" output-to:%3"\Report\TextCompare.html" output-options:html-color

    -> The slightly more configurable but complicated method is to open a parent folder compare session, then launch a child Table Compare session within it, update the column value in the session settings of that Table Compare, but then update the dropdown from "Only use for this view" to "Use for all files in parent session". Then click Ok, return to the parent Folder Compare session and Save that session. The script can then load that specific folder compare, which will use the saved child session settings.

    The other modification from above is, after the load, to expand and select the files you want to generate the report with. The file level reports require a selection of the files you want to generate on, and the expand all command allows you to select files within subfolders. These steps/script mirror the same steps you would need to take in the graphical interface to generate the report.
    Aaron P Scooter Software

    Comment

    • prasadjs86
      Visitor
      • Jan 2017
      • 8

      #3
      Hi Aaron,

      Thanks for reply.
      For first suggestion is not working. below is code which I had ran

      load <default>
      criteria rules-based
      load "%1" "%2"
      select diff.files
      data-report layout:summary options:display-mismatches title:"File Compare Report" output-to:%3"\Report\TextCompareSummary.html" output-options:html-color
      data-report layout:interleaved options:ignore-unimportant,display-mismatches,line-numbers title:"Differences" output-to:%3"\Report\TextCompare.html" output-options:html-color

      1. Can you tell me do I need to update Table Compare defaults ?
      2. Do I need to load any saved sessions ?

      For second suggestion : I had followed below steps but it is not matching as steps given by you. please suggest if any change in steps:
      Open Folder Compare> Click Edit Defaults > Click Open> From Toolbar, Select Session > New> Table Compare , Session Settings > Columns Tab, Double click on Column 9 , Uncheck Use default checkbox, Check Unimportant, Click OK.
      In Dropdown , it shows "Use for this view only" and "Also update session defaults".
      Can you tell me what should I select here ?

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16000

        #4
        Whoops, I missed a syntax error in the original posting. The %3 variable needs quotes to surround it:
        "%3""\Report\TextCompareSummary.html"
        (or pass the full file path on the command line, and use just "%3")

        What is the error you are currently seeing?


        1. You can update the defaults, if it is ok to also apply this to any comparison, other script or graphical interface.
        2. This is the "more configurable method" I mention above. If you save a specific Folder Session with specific Child Session Settings, the script can load that as a template (instead of loading the <default> template). It just requires a bit more steps to setup in the graphical interface; once created, the script just loads that session name as the first step, instead of load <default>

        Sorry, I missed an important step in the setup instructions. To edit the child settings, you'll need to load a folder that contains files. I'd suggest loading the actual folders you intend to compare. Then double click a file to load a child session. The dropdown will then have "Use for all files in parent session" as an option if double clicked loaded from a parent folder compare. The method you used is creating a new tab/session, but it isn't a child. You can then Save the parent Folder Compare (with the paths to target folders, or remove the paths and re-save it to make it a template).
        Aaron P Scooter Software

        Comment

        • prasadjs86
          Visitor
          • Jan 2017
          • 8

          #5
          Hi Aaron,
          I have tried to do the setting which you have given in point 2 ; but unable to complete it.. if you can help me steps to do that..will really helpful.

          Also, even after making changes as "%3" .. I am unable to ignore 9th Column from file, can you please help me to get it resolved..

          till now I have compare 7000 files out of which 391 files are shows different only because of 9th column difference.(which I want to ignore when I am using it in script).

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16000

            #6
            Hello,

            To test, let's start with the graphical interface.

            Launch a new blank Folder Compare, load two of your folders and let the compare load. Set the Session menu -> Session Settings, Comparison tab (with defaults timestamp,size, override left enabled) and also enable Rules-based content comparison.

            Double click on a file in this folder compare, use the file view's Session menu -> Session Settings to update the Unimportance, and before you click OK, update the dropdown from "Use only for this view" to "Use for all files in parent session". Click ok, and back in the main parent, use the Session menu -> Save Session.

            Then delete the base folder paths, so the folder compare is empty, and use the Session menu -> Save Session As: new name "template".

            You now have two saved sessions, one with the folders loaded and a template version.
            Close BC4, reopen, and open the saved session with folders. If you double click into the files, do they properly load with the child session settings and are Unimportant without changing anything?
            If yes, close BC4 again, load the template session, and then load your folders into it. Repeat opening a file, and does it also load the child session settings correctly?
            If yes, then use template as part of the script by:
            load template
            load "c:\folder1" "c:\folder2"
            expand all
            folder-report layout:side-by-side output-to:"c:\bcreports\bcreport.html" output-options:html-color

            Does this report show the correct Similar status icon between files that are only unimportant?
            Aaron P Scooter Software

            Comment

            Working...