作者:SU大肥婆_545 | 来源:互联网 | 2023-05-28 10:24
我正在寻找一种在选择中引用单词的快速方法,比如我是从由制表符或空格字符分隔的文本块构建多个插入语句.
可以说我有
STUFF OPEN F 0 0 00:00:00-23:59:59
STUFF OPEN M 0 0 00:00:00-23:59:58
STUFF OPEN R 0 0 00:00:00-23:59:59
STUFF OPEN S 0 0 00:00:00-23:59:59
STUFF OPEN T 0 0 00:00:00-23:59:59
STUFF OPEN U 0 0 00:00:00-23:59:59
STUFF OPEN W 0 0 00:00:00-23:59:59
我想得到
"STUFF" "OPEN" "F" "0" "0" "00:00:00-23:59:59"
"STUFF" "OPEN" "M" "0" "0" "00:00:00-23:59:58"
"STUFF" "OPEN" "R" "0" "0" "00:00:00-23:59:59"
"STUFF" "OPEN" "S" "0" "0" "00:00:00-23:59:59"
"STUFF" "OPEN" "T" "0" "0" "00:00:00-23:59:59"
"STUFF" "OPEN" "U" "0" "0" "00:00:00-23:59:59"
"STUFF" "OPEN" "W" "0" "0" "00:00:00-23:59:59"
只需点击一下即可.在np ++中,我必须找到替换3次,只是想知道我是否可以用较少的手工劳动来快速完成这项工作?(如选择,点击,完成.)
我有vim,notepad ++,Eclipse,VS 2013
没有emacs,虽然如果我能在cygwin中运行它并且更快地做这件事,我愿意试一试
1> romainl..:
在Vim中,您可以使用此替换:
:%s/\S\+/"&"/g
读取为"在缓冲区(:%
)中的每一行上,用双引号()替换每个(s/search/replace/g
)一个或多个(\+
)非空格字符\S
("
),后跟匹配的字符串(&
),后跟第二个双引号("
)".