Community
    • Login

    Adding commas

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 29.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.
    • Zhana RisleyZ Offline
      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 Offline
        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 Offline
          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

          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