如何在Google Sheets中避免复制引号

huangapple go评论60阅读模式
英文:

How to avoid copying quotation marks in Google Sheets

问题

我正在处理一个Google表格,将URL标识和日期转换为脚本。我面临的问题是,当你复制公式生成的文本(包括单元格引用和TEXT公式)时,会复制不必要的引号。下面是我从单元格中复制文本时需要的格式示例。

在B列中,你可以找到日期,在I列中,你可以找到标识

var flashDeals = {
"2023-03-29": [
'f8dba2f9-d84f-4a42-9e53-99a3d200c3cb',
'6ad034f4-255f-4739-a7f2-cce3927b6a4a',
'a10f3c54-3332-48dd-9cfb-cd5cfa1f6797',
],
"2023-03-30": [
'420456df-32f8-4959-a76e-4dd9f5a752af',
'193bbed5-3e82-48c7-9ff8-400156b5a2bb',
'c81d1c00-6f6a-46e7-9c0b-e433d857874d',
],
"2023-03-31": [
'b0328bb8-a5aa-4404-83b7-26324a0e5f11',
'5c8c7622-1fab-482e-8c6c-d71610b76ed5',
'5b4db348-5473-490f-aa05-a84656bf48af',
]

此刻,当我复制单元格L2中的文本时,我得到这个结果:

"var flashDeals = {
""2023-04-07"": [
'f258a4b2-7a53-46f4-b207-6822b3e61e3e',
'5a1cc293-3955-403c-b548-6258ddccc6dc',
'e2d860f5-1a4a-43f7-829b-e4e7bcbf360f',
],

奇怪的是,当我看到单元格时,代码看起来很好,但当我复制单元格并将其粘贴到记事本中时,引号会再次出现。我需要摆脱所有“双”引号。如何解决这个问题?

英文:

I'm working on a Google Sheet that converts URL slugs and dates into a script. The problem I face is that when you copy the text that is being generated by a formula (that includes cell references and a TEXT formula) it also copies extra quotation marks that I don't need. Below you can find an example of the format I need to have when I copy the text from the cell.

Link to example Google sheet

In column B you can find the dates, in column I you can find the slug

var flashDeals = {
    "2023-03-29": [
    'f8dba2f9-d84f-4a42-9e53-99a3d200c3cb',
    '6ad034f4-255f-4739-a7f2-cce3927b6a4a',
    'a10f3c54-3332-48dd-9cfb-cd5cfa1f6797',
],
    "2023-03-30": [
    '420456df-32f8-4959-a76e-4dd9f5a752af',
    '193bbed5-3e82-48c7-9ff8-400156b5a2bb',
    'c81d1c00-6f6a-46e7-9c0b-e433d857874d',
],
    "2023-03-31": [
    'b0328bb8-a5aa-4404-83b7-26324a0e5f11',
    '5c8c7622-1fab-482e-8c6c-d71610b76ed5',
    '5b4db348-5473-490f-aa05-a84656bf48af',
]

At this moment when I'm copying the text in cell L2 I get this result:

"var flashDeals = {
    ""2023-04-07"": [
    'f258a4b2-7a53-46f4-b207-6822b3e61e3e',
    '5a1cc293-3955-403c-b548-6258ddccc6dc',
    'e2d860f5-1a4a-43f7-829b-e4e7bcbf360f',
],"

The weird thing is that when I see the cell the code looks good but when I copy the cell and put it in a notepad the quotation marks will appear again. I need to get rid of all the 'double' quotation marks. How can I solve this problem?

答案1

得分: 1

=在单元格 M2中尝试这个,然后复制粘贴到记事本中,看看是否没有这些额外的引号内容...

=substitute(L2,char(10),char(13))

英文:

Try this in Cell M2 & then copy-paste in your notepad to see if you are are devoid of these additional quotes stuff...

=substitute(L2,char(10),char(13))

huangapple
  • 本文由 发表于 2023年4月6日 23:52:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951453.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定