How to copy the multiline value of a cell without quotation mark?

1k views Asked by At

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?

3

There are 3 answers

2
PatrickdC On

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.
0
Jacob Harris On

This is a messy workaround... but if you set the sheet up so that the cells you plan to copy out are filled by something like a SPLIT function, all the cells in the SPLIT results besides the one that holds the formula will read as raw text. This would allow you to enter the cell and "select all" before copying, giving you the values without the quotes present.

This is not a good fix, as it saves little time compared to deleting the quote marks manually. But its the best I've been able to find for my own purposes.

0
Boogie Cigdemoglu On

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.