Community
    • Login

    Replace with - question for advance formating

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 433 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.
    • D Offline
      Dafidov_Poland
      last edited by

      Hi.
      Have an issue - need to do bulk update on all open files which is easy but the problem is that I have date time expression dot separated and need for date to separate it with slash so it looks like this:
      “Value”: “19.01.2022 21:48:18”

      I would like to replace it with I think regular expression so it would look like that after transformation:
      “Value”: “19/01/2022 21:48:18”

      Wanted to use regular option to replace with shortcut of ctrl+h

      Don’t know if this is possible and what to put as Replace with to get the expected result.
      Any one any idea how to sort it out> If not with that option maybe with command line etc.

      I’m on windows without option to use any other system like linux.

      Would be grateful if anyone would be able to help.
      Thank you in advance!

      CoisesC 1 Reply Last reply Reply Quote 1
      • CoisesC Offline
        Coises @Dafidov_Poland
        last edited by

        @Dafidov_Poland said in Replace with - question for advance formating:

        “Value”: “19.01.2022 21:48:18”

        I would like to replace it with I think regular expression so it would look like that after transformation:
        “Value”: “19/01/2022 21:48:18”

        The basic idea is to use capture groups — each group parenthesized in the find expression corresponds to a numbered group, $n, in the replacement:

        Find what : (\d\d)\.(\d\d)\.(\d\d\d\d)
        Replace with : $1/$2/$3

        If all dates, and only dates,consist of two digits, a period, two digits, a period, and four digits, that’s all you need.

        D 1 Reply Last reply Reply Quote 4
        • D Offline
          Dafidov_Poland @Coises
          last edited by

          @Coises Thank you - it did the work perfectly!

          1 Reply Last reply Reply Quote 1

          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