Adding commas



  • 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.



  • @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.



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


Log in to reply