谷歌表单替代了多个

google sheets substitute multiple

本文关键字:表单 谷歌      更新时间:2023-09-26

我有一个google spreadsheet,我正在从网站导入数据。当数据被提取时,它有额外的引号和等号。我可以使用Substitute函数来去掉其中一个字符,但当我尝试使用Substitution函数来删除引号和文本时,Sheets只提取一个数据单元格。

公式:

=IMPORTDATA("https://ct.thecmp.org/app/v1/index.php?do=match&task=downloadMatchResultsDetail&MatchId=12504&EventId=4&AwardId=1")

结果:提取所有数据,但包括额外的引号和=号。

公式:

=Substitute(IMPORTDATA("https://ct.thecmp.org/app/v1/index.php?do=match&task=downloadMatchResultsDetail&MatchId=12504&EventId=4&AwardId=1"),char(61),"")

结果:只提取一个单元格的数据,并且只去掉等号。

公式:

=Substitute(Substitute( IMPORTDATA("https://ct.thecmp.org/app/v1/index.php?do=match&task=downloadMatchResultsDetail&MatchId=12504&EventId=4&AwardId=1"),char(61),""),char(34),"")

结果:只提取一个数据单元格,并删除多余的引号和等号。

围绕我的一项工作已经能够达到预期的效果:我可以使用公式:

=IMPORTDATA("https://ct.thecmp.org/app/v1/index.php?do=match&task=downloadMatchResultsDetail&MatchId=12504&EventId=4&AwardId=1")

然后使用以下公式:

=substitute(substitute(B22,char(34),""),char(61),"")

对于具有导入数据的每个单元格。虽然它不是很干净,如果可能的话,我想一步到位。

在项目结束时,我会遇到的一个复杂问题是,我正在通过手机的热点导入数据。我所在的位置有覆盖范围,但不是很可靠,所以任何将传输的数据量保持在最低限度的方法都是很好的。

链接到示例电子表格:https://docs.google.com/spreadsheets/d/1-cV3llUpZsrjRb4izTXVtDPsTmP15xkWDmfKjPjopDI/edit?usp=sharing

您也可以这样做:将下载url中的"download"参数替换为单词"get"(见下文):

而不是https://ct.thecmp.org/app/v1/index.php?do=match&task=downloadMatchResultsDetail&匹配Id=12504&事件Id=4&AwardId=1

看跌期权:

而不是https://ct.thecmp.org/app/v1/index.php?do=match&task=getMatchResultsDetail&匹配Id=12504&事件Id=4&AwardId=1

那么只需为importhtml:使用一个函数

=IMPORTHTML("https://ct.thecmp.org/app/v1/index.php?do=match&task=getMatchResultsDetail&MatchId=12504&EventId=4&AwardId=1","TABLE",1)

尝试:

=arrayformula(substitute(SUBSTITUTE( IMPORTDATA("https://ct.thecmp.org/app/v1/index.php?do=match&task=downloadMatchResultsDetail&MatchId=12504&EventId=4&AwardId=1") ,char(61) , "" ),char(34),""))