Think before you speak, read before you think.

vim替换

by

in

将逗号替换为换行

:%s/\,/^M/g

^M由ctrl+V+M获得

同理

:%s/^I/\ /g

例如将 ,52,53,19,4,5,6 进行如下操作

:%s/\,/^M192.168.1./g

则会变成如下的样式

192.168.1.52
192.168.1.53
192.168.1.19
192.168.1.4
192.168.1.5
192.168.1.6

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *