Page 1 of 3 123 LastLast
Results 1 to 10 of 69

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    53

    Default Compare files with partially matching file names?

    Is it possible to enable Beyond Compare to partially compare files with partially matching file names?

    I ask this because, after burning DVD backups of my files, some of the files with longer filenames on the disk are truncated to within ISO standards which means direct comparison with their equivalents on hard disk is not easy, unless manually using the "Compare to" option.

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,916

    Default

    Hello,

    In BC3 Pro you can setup an Alignment Override that will match on a specific pattern. This would be difficult to setup in your truncation case since any different text between the matches must be explicitly defined.

    If you would like to test it out and you are running Std, please see this guide:
    http://www.scootersoftware.com/suppo...?zz=kb_evalpro
    Aaron P Scooter Software

  3. #3
    Join Date
    Oct 2007
    Location
    Pennsylvania
    Posts
    1,772

    Default

    Quote Originally Posted by Aaron View Post
    This would be difficult to setup in your truncation case since any different text between the matches must be explicitly defined.
    Actually, an Alignment Override rule does not necessarily need to have different text explicitly defined for a truncation case. For example, the following alignment rule:

    Align Left File: (.{7}).*\.txt
    with right file: $1.txt

    Will correctly align these files on the left:

    alpha123.txt
    beta123.txt
    delta123.txt
    epsilon123.txt
    gamma123.txt
    With these files on the right:

    alpha12.txt
    beta123.txt
    delta12.txt
    epsilon.txt
    gamma12.txt

    Even though characters have been truncated from the file names.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

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

    Default

    Thanks for the example, Michael. I hope the above is helpful. It is a good example a truncated filenames.

    If they have other patterns, such as GammaLongName.txt and GammaNotShortName.txt to gamma~1.txt or gamma~2.txt, it could be a bit trickier. If you could post an example set of files you would like to align, it would be helpful in determining a RegEx to use.
    Aaron P Scooter Software

  5. #5
    Join Date
    Oct 2010
    Posts
    53

    Lightbulb

    @Michael Bulgrien - brilliant, this is what I'm looking for.

    @Aaron - to give you an example you requested for @Michael Bulgrien's solution, it would be a email file with the subject, sender and recipient as the filename, which would be long, but truncated by the DVD burning tool to conform to ISO length standards. For example a file name could be

    • arjaydavis@emailaddress.com, Aaron@beyond compare email.com, Compare files with partially matching file names.eml


    truncated to:

    • arjaydavis@emailaddress.com, Aaron@beyond compare email.com, Compare files with partially match.eml


    I don't know the exact length at which the truncation occurs but this example should illustrate, applying @Michael Bulgrien's solution should make this comparison work I would hope. Thanks.

    Quote Originally Posted by Aaron View Post
    Thanks for the example, Michael. I hope the above is helpful. It is a good example a truncated filenames.

    If they have other patterns, such as GammaLongName.txt and GammaNotShortName.txt to gamma~1.txt or gamma~2.txt, it could be a bit trickier. If you could post an example set of files you would like to align, it would be helpful in determining a RegEx to use.

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,916

    Default

    Hello,

    Well, with the example above, it looks like Michael's suggestion should work perfectly. From my own experience with ISO truncation, it was always much more extreme, but that doesn't seem to be your case.

    If you have any questions on Alignment Overrides, and it isn't behaving as you expect, please just let us know. As a Session Setting, you will want to save a Session with it set for future use, or set it as a Session Default.
    Aaron P Scooter Software

  7. #7
    Join Date
    Oct 2007
    Location
    Pennsylvania
    Posts
    1,772

    Default

    Let me add that if your file extensions differ, then the following might prove useful so long as your file names don't include a period in the actual filename as well as between the filename and extention:

    Align Left File: (.{7}).*\.(.*)
    with right file: $1.$2

    Each set of parenthesis creates a back reference. $1 returns the captured text from the first back-reference, $2 from the second, etc.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

  8. #8
    Join Date
    Oct 2010
    Posts
    53

    Thumbs up

    Quote Originally Posted by Michael Bulgrien View Post
    Let me add that if your file extensions differ, then the following might prove useful so long as your file names don't include a period in the actual filename as well as between the filename and extention:

    Align Left File: (.{7}).*\.(.*)
    with right file: $1.$2

    Each set of parenthesis creates a back reference. $1 returns the captured text from the first back-reference, $2 from the second, etc.
    Thanks @Michael Bulgrien this will enable me to work with extensions being the same but the name part of the file being truncated.

  9. #9
    Join Date
    Oct 2010
    Posts
    53

    Unhappy

    Tried these suggestions and it doesn't seem to work.

    I go into Session Settings and Misc and put in the regex and try it both with update this view and update all settings drop down options but I'm still not getting the comparison to happen, i.e. I still see blue folders/files either side indicating that the comparisons didn't match up because the filenames are different.

  10. #10
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,916

    Default

    Could you post 2 or 3 specific filename pairs you would like to see aligned? You can post here or email us privately at support@scootersoftware.com. If you email us, please include a link back to this forum post for reference. A full screen screenshot may help as well.
    Aaron P Scooter Software

Posting Permissions

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