Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2016
    Posts
    2

    Default Alignment override again

    Hi,

    I've searched the forum quite intensively, but I cannot find a solution for my specific problem.

    I want to compare the file name like H-1013_BP1_0001.jpg with H-1013_1.jpg or H-1013.jpg.

    Basically I want to override everything after the underscore. Everything else, (time stamp, size, folder,...) is supposed to be ignored.

    I've tried (.*)_\w\d.*\.jpg =$1.jpg and a few other variations I adapted from forum posts, but I did not find a working solution so far.

    Best regards

    M

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

    Default

    Hello,

    This is very close. The initial .* can be a bit greedy, so I would recommend using ^_ (not _) instead. Here's the RegEx I tried out:
    ([^_]+).*\.jpg = $1.jpg

    For matching on H-1013_1.jpg, you would need to add that to the destination explicitly:
    ([^_]+).*\.jpg = $1_1.jpg
    Aaron P Scooter Software

  3. #3
    Join Date
    Sep 2016
    Posts
    2

    Default

    Thank you! That worked like a charm!

Tags for this Thread

Posting Permissions

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