Announcement

Collapse
No announcement yet.

Alignment override with regular expression

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

  • Alignment override with regular expression

    Please help:
    I have 2 ear files, the only difference is the version numbers. i.e.
    ABC-1.5.2.ear and ABC-1.6.2.ear.

    I compare them as folder compare and ignore "1.5.2" and "1.6.2" parts of the file names. Here is what I did, some of regular expressions fails, only one give me correct answer.

    A) Failure (Does not align):
    1) Regular expression Align left file with (.*)1\.5\.4\.jar, right side with $1.\..\..\.jar
    2) Regular expression Align left file with (.*)1\.5\.4\.jar, right side with $1.+\.jar

    B) Success (Align):
    Regular expression Align left file with (.*)1\.5\.4\.jar, right side with $1\1\.6\.2\.jar

    I want to use general regular expression, so I can compare any file with version differences and do not need to edit regular expression.

    Any idea?
    Last edited by dangm; 10-Jul-2014, 09:33 AM.

  • #2
    Hello,

    Sorry, our Alignment Overrides require the different text to be explicitly defined. The "with right" section only supports Tagged Expressions ($1) referring to previously matched text from the Left, and not general RegEx. This could allow you to match any version number to a specific version, but not any version to any other version.
    Aaron P Scooter Software

    Comment


    • #3
      Ignore File Name (at least partially) not working

      Originally posted by Aaron View Post
      Hello,

      Sorry, our Alignment Overrides require the different text to be explicitly defined. ...
      Does alignment work on File Names at all (which is what I need: I would like the files compared based on the CRC only!), or is alignment working just on text content? I'm using "Flatten" for the discussion below.

      I tried various patterns, from abc.*=abc.* up to the extreme .*=.* and same with braces {.}*, none of these patterns do anything at all, i.e. I can't compare files like abc1 and abc2 which I would like to have lined up.

      More over, trying to cut off the names at a certain position or character sequence does not appear to be supported. E.g. comparing "abc.xml" with "abc (20140405).xml" should be possible, files in director made to align. A pattern for this would be something like ".* \(.*\..*"

      Am I just being daft or is there hope (maybe in V4?)

      A faithful BC User since V1...
      Rolf

      Comment


      • #4
        Hi Rolf,

        The "Actions > Align With" command doesn't work with "Ignore Folder Structure". This is because it fills in the "Limit to this folder" value in the Alignment Override it creates, which isn't matched when "Ignore Folder Structure" is on.

        If you manually define an "Alignment override" in "Session > Session Settings" then files should align. You can also use "Align With", then edit the Alignment Override it creates and delete the "Limit to this folder" value to make it work with "Ignore Folder Structure".
        Chris K Scooter Software

        Comment


        • #5
          Originally posted by Chris View Post
          Hi Rolf,

          The "Actions > Align With" command doesn't work with "Ignore Folder Structure". This is because it fills in the "Limit to this folder" value in the Alignment Override it creates, which isn't matched when "Ignore Folder Structure" is on.

          If you manually define an "Alignment override" in "Session > Session Settings" then files should align. You can also use "Align With", then edit the Alignment Override it creates and delete the "Limit to this folder" value to make it work with "Ignore Folder Structure".
          I tried the suggestions in the second paragraph with both V3 and V3, files will not align EVER. I'm assuming the pattern .*_@.*\..* should match 0001.jpg and 0001_@2014.jpg , or is that where the error starts?

          Btw., a "Limit to this folder" is never created here (remains blank). Tried various "ignore folder structure" as well (before setting the alignment override and after), all not working.

          Observations, maybe relevant to this strange behaviour: I'm ignoring time stamps, but apparently Picasa adds some internal date stamp inside the file. The V4 picture display says "same", but the difference Picture is shown in greyscale (very bizarre, is this a new feature?)

          Comment


          • #6
            Originally posted by rgbigel View Post
            I tried the suggestions in the second paragraph with both V3 and V3, files will not align EVER. I'm assuming the pattern .*_@.*\..* should match 0001.jpg and 0001_@2014.jpg , or is that where the error starts?

            Btw., a "Limit to this folder" is never created here (remains blank). Tried various "ignore folder structure" as well (before setting the alignment override and after), all not working.

            Observations, maybe relevant to this strange behaviour: I'm ignoring time stamps, but apparently Picasa adds some internal date stamp inside the file. The V4 picture display says "same", but the difference Picture is shown in greyscale (very bizarre, is this a new feature?)
            Hi

            I have the exact same needs.
            I want to be able to compare folder with jar files and align them even when the versions are different.

            Is this now possible in BC 4 ?

            Comment


            • #7
              Hello,

              To align 0001_2014.jpg to 0001.jpg, the longer name needs to be the Left text and the shorter name needs to be the Right text. You would then use something like:
              (.*)@.*(\..+)
              with
              $1$2

              Using the context menu should, generally, create the Limit To Folder field as part of it's creation, even if the files are at the root (.\). Perhaps a screenshot of the display and the declared Alignment Override would help?

              If the files are side by side, then the alignment is working. The comparison is a different set of settings that is run on aligned pairs of files. If you files show as equal in the Picture Compare, then you can use this status in the main Folder Compare view by running a Rules-based scan in the Session menu -> Session Settings, Comparison tab: leave Timestamp, Size, Override enabled and also enable Rules-based.
              Aaron P Scooter Software

              Comment


              • #8
                Hello,

                Do the version numbers shift randomly? If you can define the version information into the Alignment Override, then it could work. If the version numbers change, then the Override cannot handle this case.

                For example:
                *_versionNumber1.jar = *_versionNumber2.jar

                Would work, but if versionNumber 1 and 2 can change, then it wouldn't find the match anymore.
                Aaron P Scooter Software

                Comment


                • #9
                  Hello,

                  I am facing a similar problem, I have two folders with files named different but same extension, nevertheless when I set regex trying to enable the Alignment Override (as indicated in uploaded picture) does not work, files does not get to be side to side. Any idea what I am doing wrong? I have check the help but is not very descriptive.

                  Comment


                  • #10
                    Sorry, if the names before extension are completely random there isn't a good method to automatically align names for comparison using Beyond Compare.

                    If the name change is fixed, such as file.ext on left to prefix_file.ext on the right, then an alignment override can be used.

                    For your example, you'll need to use the right click Align With command for each pair of files to force alignment.
                    Chris K Scooter Software

                    Comment


                    • #11
                      I see, hopefully this feature might be included some day. Thanks for you fast response!

                      Comment

                      Working...
                      X