Community
    • Login

    Adding commas

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 18.4k 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.
    • Zhana RisleyZ
      Zhana Risley
      last edited by

      I need to add comma to each line after a number. For example if I am working with these codes:
      38664
      38665
      44166
      44167
      32872
      32873
      173649
      I need an easy way to add a comma to each line where there is none. So end result should look like this:
      38664,
      38665,
      44166,
      44167,
      32872,
      32873,
      173649,
      I tried find and replace with no success since I do not have the original value and do not know how to mark the empty space.
      You assistance would be greatly appreciated.

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Zhana Risley
        last edited by

        @Zhana-Risley

        Fairly straightforward IF your data is truly representatitve:

        Find-what box: (\d+)
        Replace-with box: \1,
        Search mode: ☑ Regular expression

        The explanation is:
        When finding, look for the longest contiguous run of digits–the \d means digits–the + means one or more–the ( ) will cause that digit run to be remembered for the replace. When replacing, replace each match with the original run of digits plus a comma.

        1 Reply Last reply Reply Quote 1
        • Zhana RisleyZ
          Zhana Risley
          last edited by

          You are my new ‘Rock Star!’ That worked exactly like i needed it to!!! Thanks a million!

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