Sublime Forum

Surround every word in doc with double quotes ""

#1

I have a word list / dictionary I am trying to convert to JSON. I need to place double quotes “” around every word in the document because they are strings. Words are seperated by commas and occasional periods and there are line breaks. Thank you in advance.

Craw, daw, law, claw, draw, flaw, gnaw, jaw, maw, paw, raw, scraw, shaw.
(x1000 lines like this)

"Craw", "daw", "law", "claw", "draw", "flaw", "gnaw","jaw", "maw", "paw", "raw", "scraw", "shaw".
(x1000 lines like this)
0 Likes

#2

I found a solution to my particular layout.
I did ctrl+h and entered REGEX \s and replaced with "
Then I ctrl+h and entered in Find What: , (a comma) and replaced that with ",

0 Likes

#3
  1. Select ', ’
  2. ALT+F3
  3. Type ‘", "’
  4. Home
  5. Type "
  6. End, left :stuck_out_tongue:
    7 Type "

you get the idea… no need for packages or regular expressions

0 Likes