1

I have a cell with a multiline value. For example:

Testing line 1
Testing line 2

When I copy it and paste it at any text editor, there are quotation mark at the front and at the end of the value. That is

"Testing line 1
Testing line 2"

How can I get rid of it?

Myrick Chow
  • 332
  • 1
  • 6
  • 16

2 Answers2

0

This is an expected behavior. The quotation marks are necessary to distinguish the groupings of the data with respect to each cell. In the example below, "TEST and TEST2" are separated from that of "TEST3 and TEST4" (with the use of quotation marks) since both pairs belong to different cells.

replication

To remove the quotation marks, i recommend the following workarounds:

  1. Manually copy the data from within the individual cells by double clicking the cell.

solution1

  1. The other method would be to copy the cells as is and then hit search and replace the quotation marks with blanks.
PatrickdC
  • 1,385
  • 1
  • 6
  • 17
  • Thanks Patrick. I used the word around solutions before but found that it is not convenient for my routine job. It would be better if the Google engineers update this for us. By the way, I used the Mac Numbers app and have the same result. No sure if this is the industrial standard for having this. – Myrick Chow May 15 '22 at 02:14
  • I assume that this is the standard for this case. I have also tried to do the same method with google docs (through paste without formatting) and I still got the same data with quotation marks. – PatrickdC May 17 '22 at 00:32
0

Instructions for Sanitizing Multiline Data from Google Sheets

When you copy multiline data from Google Sheets possibly containing CHAR(10), it may include extraneous double quotes as well as unnecessary beginning and ending single quotes.

Solution:

  1. Add the following sanitize command to your ~/.zshrc file:

    sanitize() { echo "$1" | sed 's/""/"/g' | sed 's/^"//' | sed 's/"$//' | pbcopy; }
    
  2. Use the command sanitize '<STRING>' after copying multiline data from Google Sheets. Replace <STRING> with the data you've copied.

By following these steps, your automatically copied string will be formatted as desired.