I'm looking for a quick way to quote words in a selection, like if I were to build many insert statements from a block of text separated by tab or space character.
Lets say I have
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
I want to get
"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"
In one click or less. In np++ I had to do find replace 3 times, just wondering if I could do this quickly with less manual labor? (Like select, click, done.)
I have vim, notepad++, Eclipse, VS 2013
No emacs, though I would be willing to give it a shot if I can run it in cygwin and do this kind of thing faster
In Vim, you could use this substitution:
:%s/\S\+/"&"/g
which reads as "on every line in the buffer (:%
), substitute every (s/search/replace/g
) one or more (\+
) non-whitespace character (\S
) with a double quote ("
), followed by the matched string (&
), followed by a second double quote ("
)".