Community
    • Login

    REGEX: Change the name in reverse order

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    1 Posts 1 Posters 9 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Neculai I. FantanaruN Online
      Neculai I. Fantanaru
      last edited by Neculai I. Fantanaru

      The names are upside down, I want to change them in ascending order. They are from 152 to 162 in the name on the hdd, but actually it was a mistake, they should have the files in the reverse order. So after replace I will have 162 instead of 151 and so on.

      Example:

      masini-unelte-emil-botez-carte-p1_compress_Page_151.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_152.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_153.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_154.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_155.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_156.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_157.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_158.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_159.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_160.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_161.jpg
      masini-unelte-emil-botez-carte-p1_compress_Page_162.jpg
      

      So the basis would be this.
      FIND: masini-unelte-emil-botez-carte-p1_compress_Page_\d+(.*?)\.jpg

      from here I have to select all the names and change the part of \d+ i.e. the numbers, so that I can reverse them.

      Output must be: (162 ↔ 151; 161 ↔ 152; 160 ↔ 153...)

      I try this, but not very good:

      FInd: _Page_(15([1-9])|16([0-2]))\.jpg
      Replace: _Page_\2\3\1.jpg

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors