search

Home  >  Q&A  >  body text

How to use vim to quickly organize numbers

I have this number in my file:

123456
223456
333456
443456

I want to use vim to organize it like this:

123456,223456,333456,443456

This file is very long, and it will definitely not be efficient if you edit it bit by bit. Is there any good way to record macros?

phpcn_u1582phpcn_u15822813 days ago929

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-16 16:37:48

    If you want to convert the branch data into comma-separated data, you can use the following replacement command:
    :%s/$n/, /g

    reply
    0
  • Cancelreply