Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 42
  1. #21
    Join Date
    Oct 2009
    Location
    Sydney
    Posts
    51

    Default

    Quote Originally Posted by Michael Bulgrien View Post
    Try this:

    Align left file: [0-9,_]+(IMG_\d\d\d\d.JPG)
    with right file: $1

    It should work if your date qualified files are on the left.
    Woohoo! Many thanks Michael. I may even take the time to try to understand the regular expression. This is very useful.

    Regards, AB

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

    Default

    [0-9,_] defines a set of valid characters. The square brackets simply enclose the set. The actual characters are 0 through 9 and the underscore character. Since \d also represents a numeric digit, this could also have been written [\d,_]

    + means that the prior item occurs one or more times. So we are including any combination of numeric digits and underscores at the beginning of the regular expression.

    (IMG_\d\d\d\d.JPG) The four \d explicitly define four numeric digits. This could also have been written (IMG_\d+.JPG) to indicate one or more digits without limiting it to four, or (IMG_\d{4}.JPG) with {4} meaning repeat the prior item exactly 4 times.

    (IMG_\d\d\d\d.JPG) The ( ) indicate that whatever matches the expression inside should be assigned to a variable to be used later.

    $1 is the variable being used later. It contains what was matched in the ( ) on the other side. If you had more than one set of ( ), you would have more than one variable assigned: $2, $3, etc.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

  3. #23
    Join Date
    Oct 2009
    Location
    Sydney
    Posts
    51

    Default

    Quote Originally Posted by Michael Bulgrien View Post
    (IMG_\d\d\d\d.JPG) The ( ) indicate that whatever matches the expression inside should be assigned to a variable to be used later.

    $1 is the variable being used later. It contains what was matched in the ( ) on the other side. If you had more than one set of ( ), you would have more than one variable assigned: $2, $3, etc.
    At the risk of pushing my luck beyond reasonable bounds...

    I actually have images from more than one camera, so some are IMG_xxxx, some are DSCxxxxx, and so on. I would therefore like to have more than one set of ( ) and matching $1, $2, $3, etc.. I understand the thrust of what you are saying but am unsure of precisely what to code for left and right to replace your earlier simple case.

    Quote Originally Posted by Michael Bulgrien
    Align left file: [0-9,_]+(IMG_\d\d\d\d.JPG)
    with right file: $1
    Regards, AB

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

    Default

    Sorry, you won't be able to capture and use more than one backreference in Beyond Compare for the purpose of aligning different kinds of files.

    Simply create a separate alignment override definition for each file type and you're done.

    Or you could do something like this:

    Align left file: [0-9,_]+([A-Z]{3}_*\d+\.JPG)
    with right file: $1

    [A-Z]{3} Three alphabetic characters will match both IMG and DSC.
    _* Using an * instead of a + means zero or more instances instead of one or more instances of the previous character. This, then, will recognize the _ in the IMG format but not require one for the DSC format.
    Last edited by Michael Bulgrien; 21-Jan-2010 at 06:26 AM.
    BC v4.0.7 build 19761
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

  5. #25
    Join Date
    Oct 2009
    Location
    Sydney
    Posts
    51

    Default

    Excellent Michael. Thanks for the code and the clear explanation. Much appreciated.

    Regards, AB

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

    Default

    Thanks for the creative Regular Expression solution and clear explanation, Michael.
    Aaron P Scooter Software

  7. #27
    Join Date
    Nov 2004
    Posts
    86

    Default

    Could this be added to the BC wishlist ? That is, find duplicate files in a folder comparison, regardless of filename, just match on file size and CRC.

    btw, when I searched for 'crc' I kept getting "Sorry - no matches. Please try some different terms.", had to use Google which told me 122 hits ? Possibly strings of length 3 are ignored ?

    Peter

  8. #28
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,609

    Default

    Finding duplicate files is still on our wish list, we do keep track of how often it is requested.

    Yes, the forum software that we're using has a minimum of 4 characters for search terms. I sometimes use Google myself to search our forums. In Google I enter the term I'm searching for plus "site:http://www.scootersoftware.com/vbulletin/" to limit the search to our forums.
    Chris K Scooter Software

  9. #29
    Join Date
    Nov 2004
    Posts
    86

    Default

    Quote Originally Posted by Chris View Post
    Finding duplicate files is still on our wish list, we do keep track of how often it is requested.
    Okay, so does that mean if I post a request here each day, it will get on the list quicker ?

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

    Default

    Quote Originally Posted by peterr View Post
    Okay, so does that mean if I post a request here each day, it will get on the list quicker ?
    I think we'll notice if it's just you. But we have had several users request this. It is something we would like to do, but we have several other large projects already scheduled and being worked on, so it is still on the Wishlist for now.
    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
  •