VIM 使用子匹配重排CSV文件的字段
1. 使用子匹配重排CSV文件的字段
- 案例
last name,first name,email
neil,drew,drew@vimcasts.org
doe,john,john@example.com
- 引用1 ,2 ,3 调换顺序
%s/\v([^,]+),([^,]+),([^,]+)/\3,\2,\1/g
last name,first name,email
neil,drew,drew@vimcasts.org
doe,john,john@example.com
%s/\v([^,]+),([^,]+),([^,]+)/\3,\2,\1/g