gpt4 book ai didi

python - 如何将包含逗号和引号的 Google 公式添加到 CSV 文件?

转载 作者:行者123 更新时间:2023-12-02 01:24:37 24 4
gpt4 key购买 nike

我正在尝试从 Python 输出 CSV 文件并将其中一个条目设为 Google 表格公式:

这就是公式 var 的样子:

    strLink = "https://xxxxxxx.xxxxxx.com/Interact/Pages/Content/Document.aspx?id=" + strId + "&SearchId=0&utm_source=interact&utm_medium=general_search&utm_term=*"
strLinkCellFormula = "=HYPERLINK(\"" + strLink + "\", \"" + strTitle + "\")"

然后对于 CSV 的每一行,我都有:

    strCSV = strCSV + strId + ", " + "\"" + strTitle + "\", " + strAuthor + ", " + strDate + ", " + strStatus + ", " + "\"" + strSection + "\", \"" +  strLinkCellFormula +"\"\n"

这不太有效,Google 表格的超链接公式如下所示:

=HYPERLINK(url, title)

我似乎无法逃脱那个逗号。因此,在我的工作表中,我得到了一个带有标题的附加列,显然该公式不起作用。任何帮助将不胜感激。

最佳答案

尝试使用 ; 作为公式参数分隔符。应该是一样的。

关于python - 如何将包含逗号和引号的 Google 公式添加到 CSV 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75073571/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com