Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    May 2009
    Posts
    5

    Default Ignoring the first line of certain file types

    I am trying to compare two projects where the first line of every .aspx file is different. Is it possible to configure Beyond Compare to ignore the difference or ignore the first line completely? An example of the differences is below.

    <%@ Page Language="C#" Inherits="Foo.Bar" Codebehind="Bar.aspx.cs" %>
    <%@ Page Language="C#" Inherits="Foo.Bar" CodeFile="Bar.aspx.cs" %>
    Last edited by philw; 05-May-2009 at 09:37 AM.

  2. #2
    Join Date
    Oct 2007
    Location
    Hannover, Germany
    Posts
    356

    Default

    Go to Tools/File Formats and add a new element (i. e. ASPX_1st).

    Settings
    --------
    General/Mask: *.aspx
    Grammar/New
    Element name: FirstLine
    Category: Lines
    Check "or line 1"

    If you wish to use this file format only for comparing special projects and not for all aspx-files you should uncheck this file format in Tools/File Formats.

    Then create a folder compare session for your special projects and go to Session/Session settings/Misc/Enabled file formats and check ASPX_1st there.
    Don't change the selection "Use for this view only" on the bottom.

  3. #3
    Join Date
    May 2009
    Posts
    5

    Default

    I apreciate the quick reply. I created a new ASPX File Format with your suggested grammer; however, It has not resolved my issue. When I compare the two directories I still see .aspx files that are identical, with the exception of the first line. I was concerned that default HTML File Format might be causing an issue because it contains *.aspx but I see the same behavior when HTML is unchecked. Is there anything else I should be looking for?

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    When you open the pair of Text files, is it using your File Format automatically? It should use the topmost associated with *.aspx in the Tools -> File Formats dialog. Define it as category Lines: or line 1 and next 0 lines?

    Then in Session Settings, uncheck "FirstLine" in the Importance tab?

    Also, are you using the latest release of BC3?
    Aaron P Scooter Software

  5. #5
    Join Date
    May 2009
    Posts
    5

    Default

    I am using Version 3.1.2 (build 10221).

    The ASPX_1st format/mask is the top most entry on the File Formats screen. Originally I had configured the Grammar Item as follows:

    Element Name: FirstLine
    Category: Lines
    or line 1: Checked
    and next: 1 lines
    This element is case sensitive: Checked

    I have tried changing it to use and next 0 lines but that has not resolved the issue. I have attached a screenshot of my Grammar Item in case that helps.

    I do not see an "Importance" tab on the "Folder Compare - Session Settings" page. Where is it located?

    Thanks again
    Last edited by philw; 05-May-2009 at 02:41 PM.

  6. #6
    Join Date
    Oct 2007
    Location
    Hannover, Germany
    Posts
    356

    Default

    Your screenshot looks ok, so it should be the importance setting as Aaron mentioned.
    You can find it on the "Text Compare - Session Settings" page and also on the "Home" page/Edit session defaults/Text Compare.
    Last edited by Lutz; 06-May-2009 at 03:22 AM. Reason: screenshot added

  7. #7
    Join Date
    May 2009
    Posts
    5

    Default

    I added the FirstLine grammar to the Text Compare importance screen; however, it has not resolved my issue. Do you have any other suggestions?

  8. #8
    Join Date
    Oct 2007
    Location
    Hannover, Germany
    Posts
    356

    Default

    You have to uncheck FirstLine.

  9. #9
    Join Date
    May 2009
    Posts
    5

    Default

    Thank you. Unchecking the option on the Importance tab resulted in text comparisons working as desired. Is there a way I can apply this change to the Folder Comparison so that when I attempt to merge two projects, aspx pages that only differ on the first line do not show up?

  10. #10
    Join Date
    Oct 2007
    Location
    Hannover, Germany
    Posts
    356

    Default

    You should create a Folder Compare Session as I described in my first reply (you may leave the base folders empty).
    • Open the session with your projects and open a text comparision of two aspx-files.
    • Uncheck FirstLine importance and select one of the "Use for ... parent session" settings.
    • Close the text comparision.
    • Select View/Show Differences and Ignore Unimportant Differences.
    • Folder Compare/Session Settings/Specs:
      You may clear the base folders.
    • Folder Compare/Session Settings/Comparision:
      Check Compare contents/Rules-based comparision.
    • Folder Compare/Session Settings/Handling:
      Check Folder handling as desired.
    • Folder Compare/Session Settings/Misc:
      Check ASPX_1st in Enabled file formats.
    • Save the folder compare session.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •