Skip to content
Advertisement

Enquote multiple text fields in CSV – Sublime Text 3

I have a CSV file containing info to be inserted in a database with SQL using insert similar to the below example:

I want to separate the text values from the null values. Specifically, I want to enquote text values and leave null as it is. Is there a way to do this using Sublime Text 3? Please bear in mind that I am not familiar with regexp. Each field in my DB is either VARCHAR or TEXT.

Advertisement

Answer

Example you supplied

Activate RegEx in ST3 Find and Replace.

Find Value

Replace Value

Apply Replace All

Result

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement