• Login
Community
  • Login

Convert Clock Hours to Double Digits

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 230 Views
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.
  • S
    Sean Perry
    last edited by Jul 8, 2020, 8:52 AM

    I have multiple files where the output file shows hours from 1 to 9 as single digits, and all other hours as double digits, and need to convert all clock hours to double digits, so exhibit a)

    08/08/2020,9:20,00:50,Forged In Fire 7,ITA
    08/08/2020,10:10,00:50,Forged In Fire 7,ITA

    would become exhibit b):

    08/08/2020,09:20,00:50,Forged In Fire 7,ITA
    08/08/2020,10:10,00:50,Forged In Fire 7,ITA

    Is there a simple command to do this?

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Jul 8, 2020, 10:03 AM Jul 8, 2020, 9:33 AM

      Hello @sean-perry and All,

      I suppose that this regex S/R will do the trick !

      SEARCH \b\d:\d\d,\d\d:\d\d

      REPLACE 0$0

      And, generally speaking, this other regex S/R should work :

      • With any delimiter, after the minute digits :

      • With, either, the syntaxes #:##, #:##Del## and #:##Del_1##Del_2##

      where Del, Del_1 and Del_2 represent delimiters

      SEARCH \b\d:\d\d([[:punct:]]\d\d([[:punct:]]\d\d)?)?

      REPLACE 0$0

      Best Regards

      guy038

      1 Reply Last reply Reply Quote 1
      • S
        Sean Perry
        last edited by Jul 8, 2020, 6:05 PM

        @guy038 said in Convert Clock Hours to Double Digits:

        \b\d:\d\d([[:punct:]]\d\d([[:punct:]]\d\d)?)?

        You are correct, that did the trick and saved me a lot of time. Thank you!

        1 Reply Last reply Reply Quote 1
        3 out of 3
        • First post
          3/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors