Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 792
sal i Avatar asked Jul 23 '10 05:07

sal i


People also ask

How do you do double quotes in Google Sheets?

Type Shift + ' to add a double quote, which Google Docs defaults to using Smart Quotes for. They're called Smart because they automatically identify if they should be formatted as start or end quotes.

How do you add two quotes to every cell in Excel?

Highlight the cells you want to add the quotes. Go to Format–>Cells–>Custom. Copy/Paste the following into the Type field: \"@\" or \'@\' Done!

How do I make text always wrap in Google Sheets?

Wrap Text on Google Sheets via Mobile App Check it out below. Open spreadsheet on Google Sheets. Select the cells, columns, or rows you wish to text-wrap. Press the Formatting button on the top right (icon of the letter A with horizontal lines) > Click the Cell tab > Toggle Wrap text button on.


1 Answers

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 :)

like image 75
Henrique G. Abreu Avatar answered Sep 29 '22 07:09

Henrique G. Abreu