繁体   English   中英

将 HTML 导入 Google 表格时,order by 和 select col 函数以及标题存在问题

[英]When importing HTML into Google Sheets, there are issues with the order by and select col functions as well as the header

我正在使用这个函数 =QUERY(INDEX(SUBSTITUTE(IMPORTHTML (I2 & "?refresh=" & I6,I3,I4), "*", )), "SELECT Col1, Col2, Col3, Col4 ORDER BY Col1 ASC" )

这是在表之间返回带有标题的数据。

此外,我们是否可以使用偏移量来完全避免标题,如果是的话,什么是正确的语法链接到导入页面

https://ipowala.in/ipo-subscription-status/

您不妨在 QUERY 中完成所有工作

=ARRAYFORMULA(
  QUERY(
   SUBSTITUTE(
    IMPORTHTML("https://ipowala.in/ipo-subscription-status/?refresh="&I6,"table",1),
    "*",""),
    "select Col1, Col2, Col3, Col4
     where not Col1 = 'IPO Name'
     order by Col1",0))

这将放弃标题

如果您想在保留实际值的同时删除 * ,那就有点不同了。 我们可以利用转换为值的错误(双连字符)并在其中运行替换。

=ARRAYFORMULA(
  QUERY(
   IFERROR(
    --IMPORTHTML("https://ipowala.in/ipo-subscription-status/?refresh="&I6,"table",1),
    SUBSTITUTE(
     IMPORTHTML("https://ipowala.in/ipo-subscription-status/?refresh="&I6,"table",1),
    "*","")),
    "select Col1, Col2, Col3, Col4
     where not Col1 = 'IPO Name'
     order by Col1",0))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM