Community
    • Login

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

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 939 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.
    • Ebenezer DareE
      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
        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
          Ebenezer Dare @Scott Sumner
          last edited by

          @Scott-Sumner

          Thanks Scott.
          It works perfectly.

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