javascript - Javascript 抓取清理 - TMview
问题描述
我使用 chrome 扩展为数据库抓取数据,需要 JavaScript 清理功能的帮助。
输出是一个 .xls 文件,我通过运行 javascript 来删除不需要的数据。
当前输出 我需要删除没有任何日期的行中的独立“ - ”。
我已经尝试过这个解决方案 - 但它不会让我在超过 1 列中做到这一点。
this.values[9] = this.values[9];
let [day, month, year] = this.values[9].split("-");
this.values[9] = this.values[9].replace("-","")
this.values[9] = `${day}-${month}-${year}`;
this.values[9] = this.values[9]; 在这种情况下,我是如何定位脚本中的应用程序日期行的
非常感谢任何指导!
解决方案
this.values[9] = this.values[9] == "-" ? "" : this.values[9];
推荐阅读
- python - Update or create bunch of rows - Django
- reactjs - While Calling Django Api On React Error is No 'Access-Control-Allow-Origin' header is present on the requested resource
- javascript - 错误:在使用 yarn encore dev 时安装刺激以使用 enableStimulusBridge()
- sql - Oracle - 从对偶中选择多个别名行
- node.js - Cant attach any file with courier nodejs gmail api
- javascript - how to display text information on hover in chart js?
- google-sheets - 为什么我的自定义函数会出现公式解析错误?
- bash - Bash sed 命令给了我“无效的命令代码”。
- docker - Docker - Can´t change default password of phpmyadmin
- python - “charmap”编解码器无法在位置 0 编码字符“\u010c”:字符映射到
MariaDB 和 SQLAlchemy