Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regex to find strings separated by comma, and then add quotes?

I'm using Sublime Text 3 and have a CSV file with 1200 tax rates in this format:

Code,Country,State,Zip/Post Code,Rate,default
US-NY-10001-Rate 1,US,NY,10001,0.08875,
....

I need a regex to find each value separated by a comma so I can then wrap quotes around it.

Is this possible?


1 Answers

Find the following regular expression (using capturing group and backreference):

([^,\n]+)

and replace it with:

"\1"

enter image description here

like image 80
falsetru Avatar answered Oct 30 '25 00:10

falsetru