UiPath Documentation
activities
latest
false
工作流活动
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

Generate Data Table from Text

Generate Data Table from Text activity that generates a DataTable variable from structured text.

UiPath.Core.Activities.GenerateDataTable

从非结构化文本生成数据表。此活动用于选择生成表格的列和行分隔符。使用“屏幕抓取”窗口中的“生成表格”功能时,会自动生成此活动。

项目兼容性​

跨平台 | | Windows | Windows - 旧版

跨平台配置​

  • “输入”- 结构化文本的来源。
  • “解析方法” - 表格的数据格式化选项。可用选项包括:
    • CSV(逗号分隔值)
    • 自定义
    • 定宽列

属性​

  • Autodetect column types - When selected, automatically detects the column or row type, whether it is String, Int32, etc.
  • Use first row as column headers - If enabled, uses the first identified row as the column header.
  • Ignore first column - If enabled, the first identified column is ignored.
  • “出错时继续”- 指定在活动引发错误时是否应继续自动化操作。该字段仅支持“布尔值”(True 和 False)。默认值为 False。因此,如果该字段为空且活动引发错误,系统将停止执行项目。如果该值设为“True”,则无论出现何种错误,系统都将继续执行项目。
  • Data table - The DataTable variable that contains the generated table.

Windows、Windows - 旧版配置​

  • 输入: - 结构化文本的来源。在StudioX中,您可以使用Plusdocs image图标选择一个可用选项:
    • 项目笔记本、父级 Excel 文件或 Outlook 帐户中的数据。例如,选择一个 Excel 文件,然后选择“在 Excel中指明”以指明文件中的单元格,或者在 Outlook 中选择一个电子邮件,然后在电子邮件中选择包含要搜索的值的字段。
    • “运行时询问”- 执行项目时提示输入值。
    • “从剪贴板粘贴” - 将您以前复制的值粘贴到项目中的剪贴板中。
    • “文本”- 在文本生成器中输入文本。
    • Use Saved Value - Select a value that you previously saved for later use in the project.
    • Open in Advanced Editor - Enter a VB expression.
  • “选项” - 单击以打开“生成表格向导”窗口。
  • 数据表- 选择数据表的保存位置。在StudioX中,您可以使用Plusdocs image图标选择一个可用选项:
    • 选择父级 Excel 文件或“项目笔记本”,然后选择要将数据保存到的命名范围、表格或工作表,或者选择“在 Excel 中指明”以直接从文件中选择。
    • “复制到剪贴板”- 将公式保存到剪贴板。
    • “保存以便以后使用”- 保存输出内容以供之后在项目中用作另一个活动的输入。
    • Open in Advanced Editor - Enter a VB expression.

属性​

选项​
  • “出错时继续”- 指定在活动引发错误时是否应继续自动化操作。该字段仅支持“布尔值”(True 和 False)。默认值为 False。因此,如果该字段为空且活动引发错误,系统将停止执行项目。如果该值设为“True”,则无论出现何种错误,系统都将继续执行项目。
  • “显示名称”- 活动的显示名称。
    备注:

    如果“Try Catch 异常处理”中包含该活动且“出错时继续”属性的值为“True”,则系统在执行项目时不会捕获任何错误。

Fixed formatting options​
  • “列大小”- 指定在表中创建的列的大小。此字段仅支持 IEnumerable变量。
Formatting options​
  • “列分隔符”- 指定用作列分隔符的字符。该字段仅支持字符串变量。
  • “CSV 解析”- 选择是否要将输入数据解析为 CSV。该字段仅支持“布尔值”(True 和 False)。默认值为 FALSE。
  • “新行分隔符”- 指定要用作新行分隔符的字符。该字段仅支持字符串变量。
输入​
  • 输出: - 指定要转换为表的非结构化数据的来源。此字段仅支持字符串变量。
  • “位置”- 如果使用 OCR 进行抓取且选中“获取文字信息”复选框,该字段会包含具有“文字信息”值的“IEnumerable<KeyValuePair<Rectangle,String>>”变量。
其他​
  • “私有”- 选中后将不再以“Verbose”级别记录变量和参数的值。
输出​
  • “数据表”- 此为包含生成表的“数据表”变量。
Table options​
  • “自动检测类型”- 选中后,系统将自动检测列或行类型,包括字符串、Int32 等。
  • “使用列标头”- 如果选中,则使用第一个标识的列作为列标头。
  • “使用行标头”- 如果选中,则使用第一个标识的行作为行标头。

Generate Data Table wizard​

备注:

The Generate Data Table wizard is only available for Windows and Windows - Legacy projects.

Select the Options... button to open the Generate Data Table wizard. Use it to configure and preview the resulting table format.

Table options​

  • Autodetect column types - If checked, automatically detects the column or row type.
  • Use first row as column headers - If checked, uses the first identified row as the column header.
  • Ignore first column - If checked, ignores the first identified column.

Data formatting options​

  • “格式”- 选择要使用的输入格式:
    • CSV (comma separated value) - Lets you set Column separators.
    • Custom - Lets you set Column separators and New line separator.
    • Fixed width columns - Lets you set the column width of all columns.
  • Column separators - Specify the character that is to be used as a column separator.
  • New line separator - Specify the character that is to be used as a newline separator.
  • “预览”- 单击以生成结果表格格式的预览。

“数据表排序”活动使用示例​

本示例说明了如何使用“生成数据表”活动生成包含特定信息的表格。

此自动化流程的构建方法如下:

  1. 打开 Studio ,创建一个新“流程”。

  2. 将“序列”容器拖动至“工作流设计器”。

    变量名称变量类型默认值
    DT1数据表
    结果字符串
    名称泛型值
  3. 在“序列”容器中添加“构建数据表”活动。

    • 在“属性”面板中,向“CSV 解析”字段添加“False”值。
    • 在“新行分隔符”字段中添加Environment.NewLine值。
    • 在输入字段中添加表达式 "Name;Surname; John;Doe; James;Liam;"。
    • 在“数据表”字段中添加“DT1”变量。
    • 选中“包含列名称”选项的复选框。
  4. Select the Options... button to open the Generate Data Table wizard.

    • 从“格式”下拉菜单中选择“自定义”选项。
    • Select the semicolon option from the Column separators drop-down list.
    • Select the space option from the New line separator drop-down list.
    • 单击“确定” 以关闭向导。
    • This is how the Generate Data Table wizard panel should look:

  5. 将“输出数据表”活动拖动至“遍历循环”活动下方。

    • 在“属性”面板中,向“数据表”字段添加“DT1”变量。
    • 在“文本”字段中添加“Result”变量。
  6. 在“输出数据表”活动下方添加“写入行”活动。

    • 在“文本”字段中添加“Result”变量。
  7. 运行流程。机器人使用输入数据生成表格。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新