Community
    • Login

    I want to convert all numbers to a single line per number

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 1.2k Views 2 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.
    • Ebenezer DareE Offline
      Ebenezer Dare
      last edited by

      Hello mates,

      Please I need help.
      I want to convert all numbers in my notepad++ on a single row to a single line per number. That is each number should be on a single line.
      For example;

      34566, 46664, 67575, 78787,

      to

      34566
      46664
      67575
      78787

      I’ll be waiting for your swift response.
      Thanks

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS Offline
        Scott Sumner @Ebenezer Dare
        last edited by

        @Ebenezer-Dare

        Try this:

        Invoke Replace dialog (default key: ctrl+h)
        Find what zone: , ?
        Replace with zone: \r\n
        Wrap around checkbox: ticked or unticked, as you like
        Search mode selection: Regular expression
        Action: Press Replace All button

        Here’s how it works:

        THE FIND EXPRESSION:

        , ?

        • [Match the character “,” literally][1 ] ,
        • [Match the character “ ” literally][1 ] ?
          • [Between zero and one times, as many times as possible, giving back as needed (greedy)][2 ] ?

        THE REPLACE EXPRESSION:

        \r\n

        • [Insert a carriage return][3 ] \r
        • [Insert a line feed][3 ] \n

        Created with RegexBuddy

        [1 ]: https://www.regular-expressions.info/characters.html
        [2 ]: https://www.regular-expressions.info/optional.html
        [3 ]: https://www.regular-expressions.info/replacenonprint.html

        RegexBuddy settings to emulate N++ regex engine: Application=boost::regex 1.54-1.57 / flavor=Default flavor / replacement flavor=All flavor / ^$ match at line breaks / Numbered capture / Allow zero-length matches

        Ebenezer DareE 1 Reply Last reply Reply Quote 3
        • Ebenezer DareE Offline
          Ebenezer Dare @Scott Sumner
          last edited by

          @Scott-Sumner

          Thanks Scott.
          It works 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