UiPath Documentation
activities
latest
false

生产力活动

上次更新日期 2026年5月11日

写入 CSV

UiPath.CSV.Activities.WriteCsvFile

描述

保存以备后用的表格数据或 Excel 文件中的数据到指定 CSV 文件的副本。复制的数据将替换 CSV 文件中已存在的任何数据。如果 CSV 文件不存在,则系统会在执行自动化时创建该文件。

配置活动

在活动正文中
  • “写入来源” - 单击字段右侧的“加号”,然后从菜单中选择要从中复制数据的位置:

    • 选择一个 Excel 文件,然后使用可用选项在 Excel 中选择表格、工作表或指定范围。
    • 使用保存的值 - 选择您先前在项目中保存以备后用的名称。
    • Open in Advanced Editor - Enter a VB expression.
  • Write to what file - Click Browse docs image next to the field and then browse to and select the CSV file where to copy the data. To create a new file when the automation is executed, browse to the folder where to create it and enter the file name. Alternatively, you can click Plus on the right side of the field, and then choose one of the available options in the menu to indicate the path of the file:

    • Excel 或 Outlook 数据。例如,您可以选择包含文件路径的单元格。
    • “使用保存的值”- 以索引的形式选择您先前保存以供以后在项目中使用的值。
    • “文本” - 在文本生成器中输入文件路径。您可以将文本与 Excel 文件单元格中的公式结合使用,例如,使用“项目笔记本”中的公式为文件名添加日期。
    • Ask when run - Prompt for a file path when the project is executed.
    • Open in Advanced Editor - Enter a VB expression.
  • “包含标头” - 如果选中,则将列标头复制到 CSV 文件中。

属性面板

常见

  • 显示名称 -“设计器”面板中活动的显示名称。

文件

  • 文件路径- 请在活动主体中查看 附加到文件 。

输入

  • 数据表 - 请在活动主体中查看 写入来源 。
  • “分隔符”- 选择在 CSV 文件中使用的分隔符:“制表符”、“逗号”(',')、“分号”(';')、“插入符号”('^') 或“竖线”('|')。

其他

  • 私有 - 选中后将不再以“Verbose”级别记录变量和参数的值。

选项

  • 添加标头 - 请在活动主体中查看 包含标头 。
  • “编码” - 选择要使用的编码类型。您可以在此处找到每种字符编码的完整代码列表。如果未指定编码类型,活动将搜索文件的字节顺序标记以检测编码。如果检测不到任何字节顺序标记,则会默认选择系统 ANSI 代码页。

“写入 CSV”活动使用示例

  • 描述
  • 配置活动
  • “写入 CSV”活动使用示例

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新