获取单元格内容

动词:getTableCell

获取位于列和行交叉处的单元格的内容。

语法

getTableCell --dataTable(DataTable) --column(Numeric) --row(Numeric) (Scalar)=value

输入

脚本 设计器 必需的 AcceptedTypes 描述
--dataTable 数据表 必需的 数据表 从中获取单元格内容的数据表。
--column 必需的 成员 单元格所在的列的数字位置。
指示列位置的数字,必须大于或等于 1。
--row 必需的 成员 单元格所在的行的数字位置。
指示行位置的数字,必须大于或等于 1。

输出

脚本 设计器 AcceptedTypes 描述
内容 原语 返回获取的单元格的内容。

示例

使用该命令通过列号后跟交叉行号找到特定单元格,获取其内容。

defVar --name excelFile --type Excel
defVar --name excelTable --type DataTable
defVar --name cellContent --type String
// Download the following file to execute the command.
excelOpen --file "tableExcelCompanyCity.xlsx" excelFile=value
excelGetTable --file ${excelFile} --getfirstsheet  --entiretable  --hasheaders  excelTable=value
getTableCell --dataTable ${excelTable} --column 2 --row 3 cellContent=value
logMessage --message "Cell Content: ${cellContent}" --type "Info"
// This example returns the following output:
// Cell contents: Armonk.

下载文件


要正确处理上述脚本,需要下载该文件并在打开 Excel 文件命令的文件参数中输入其路径。

另请参阅

  • 添加列
  • 添加行
  • 检查列在表中是否存在
  • 复制行
  • 复制表
  • 删除列
  • 删除行
  • 过滤表
  • 按名称查找列
  • 查找表单元格出现项
  • 获取列名
  • 获取列结构
  • 获取 HTML 表
  • 基于 JSON 生成表
  • 映射表行
  • 移动表行
  • 对表排序
  • 更新行
  • 将表写入文件