Alex Rivera | Logout

How to enclose every cell with double quotes in Google docs spreadsheet

Asked 2010-07-23T05:46:44.883
35

I have utf-8 data which I would like to save as CSV. My old version of Excel mangles utf-8, so I have to resort to using google's spreadsheet which handles utf-8 beautifully.

Some of my data have commas in them, so I must wrap every field of data in thCSVsv with double quotes. I have hundreds of lines, so it would take some time to do it manually and without error.

How can I accomplish this in google docs spreadsheet?

Edit
Report

1 Answer

45

First, why don't you just export your spreadsheet as csv? Google has that feature built-in. It's under the menu File > Download as > CSV

But, answering your question, it's pretty easy to wrap all values in doubles quotes. Let's say the desired values are on Sheet1 columns A to D. On Sheet2, cell A1, just place this formula:

=ArrayFormula(""""&Sheet1!A:D&"""")

The issue with the issue with the double quotes is that they're used as string delimiters, so to have them inside a string you have to type two consecutive. So, one " to open, two to have one "" and one " to close :)

answered 2011-12-01T20:53:31.880

Your Answer