No announcement yet.

Alignment Overrides question

  • Filter
  • Time
  • Show
Clear All
new posts

  • Alignment Overrides question

    I have the left and right folders looking like:

    I can get the pairs to align by right clicking on each and adding the alignment, but I can't find a normal or regular expression that would align the entire folder. So far, I've tried these expressions:

    [0-9]{8}_[0-9]{6}.*.jpg (both sides the same, regex checked)
    *_*.jpg on the left and *_*_*.jpg on the right (regex unchecked)

    Do you have any suggestions of other expressions to try? The file names will always be in the same format, but the names themselves could be completely different.

    Thanks, - jc

  • #2

    The issue you may be running into is that the definition must explicitly have the different text included in it.

    You can mask the equal text, but the different text cannot use masking characters. So for example:
    20090511_170811.jpg <> 20090511_170811_0933.jpg
    could be:
    *.jpg = *_0933.jpg
    Aaron P Scooter Software


    • #3
      Ok, thanks. The names of the files are completely random which makes it difficult to hardcode alignment rules.

      I guess what I'm looking to do is have it ignore certain patterns of the name and consider what's left of the name as the name to match as if it was the actual name of the file. For example take:

      20090511_170811.jpg <> 20090511_170811_0933.jpg

      Is there anyway to tell it to ignore the last 5 digits of the second file? In that case it would line up the files like:

      20090511_170811.jpg <> 20090511_170811.jpg

      Another example. Take:

      20060403_161329_0332.jpg <> IMG_0332.jpg

      Can I have it ignore the first 16 digits on the left and the 4 digits on the right? So that it aligns the files like:

      0332.jpg <> 0332.jpg


      • #4
        If you place the folder with the longer file names on the left, then you can use a regular expression like this:

        Align left file: (\d{8}_\d{6})_\d{4}.jpg
        With right file: $1.jpg

        The parentheses capture the enclosed value which is then accessed using the $1 back-reference. This will align 20090511_170811_0933.jpg with 20090511_170811.jpg


        Align left file: \d{8}_\d{6}_(\d{4}).jpg
        With right file: IMG_$1.jpg

        Uses a back reference to align 20060403_161329_0332.jpg with IMG_0332.jpg
        Last edited by Michael Bulgrien; 20-Aug-2010, 01:41 AM.
        BC v4.0.7 build 19761


        • #5
          Just want to post back that this is working great! The back reference is the key. BC is now even more powerful now that I have this. Thanks so much for the help.

          One thing that's really nice is that I can sync an aligned file with another and the files names remain unchanged! Really cool.

          Couple of enhancement ideas if they're useful:
          1. After making a name change outside of BC, and then refreshing BC, the alignment rules don't reapply. I had to edit a rule, save it, then edit the rule back, and then save it again to have the rules reapplied.
          2. Would be a nice-to-have, at least for the rules panel, that the Session Properties dialog could be modeless and with an "Apply" button. This way, the rules could be edited, and the list of files could still scrolled up/down with the dialog open, and the Apply button would allow to preview the edited rule without having to close the dialog.


          • #6
            Hello Jon,

            I am not seeing the same refresh behavior as you for issue #1. If I create an Alignment Override (*.pdf = *2.pdf, for example) by going to the Session Settings -> Misc tab, and create a New Alignment Override. If I rename one of my files and perform a refresh, it will either align or break alignment accordingly (if the file is renamed to 2.pdf it will align, if renamed to 3.pdf it will break alignment).

            Could you post an example alignment override you have defined? Also, are you running BC3.1.11 or BC3.2 beta?
            Aaron P Scooter Software


            • #7
              Thanks for the suggestion for #2. I'll add that to our Customer Wishlist.
              Aaron P Scooter Software


              • #8
                Late reply, sorry. I was doing a quick refresh and just figured out that probably I wasn't using full refresh to see the renamed file. So full refresh does the trick for me.