Home > Q&A > body text
For example:
111,a 222,bb 333,ccc 444,dddd 555,eeeee 666,ffffff 777,ggggggg
You can use Ctrl + v to select all the columns where the comma is located. If you want to delete all the content to the right of it, is there any shortcut?
Ctrl + v
黄舟2017-05-16 16:36:47
First select all the lines you want to replace, then :'<,'>s/,.*$//
:'<,'>s/,.*$//
大家讲道理2017-05-16 16:36:47
Directly control-v and then $d or D Not finished yet?
仅有的幸福2017-05-16 16:36:47
Use awk
awk -F ',' '{print }'
天蓬老师2017-05-16 16:36:47
You can also do this using visual-block:
gg f, <c>v $ G x