> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 读取文本文件内容

## 指令说明

**描述：** 读取指定文本文件全部内容

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/y7Z2TvwRJJef-uiI/helpcenter/commands/os/images/getfilecontentcommand-04.png?fit=max&auto=format&n=y7Z2TvwRJJef-uiI&q=85&s=5ba4d346379cad0c5c8b19b1c6a0ef18" alt="读取文本文件内容指令参数面板" width="660" height="479" data-path="helpcenter/commands/os/images/getfilecontentcommand-04.png" />

    | 参数           | 说明                                                                  |
    | ------------ | ------------------------------------------------------------------- |
    | **文件路径**     | 输入或选择文件路径                                                           |
    | **将读取内容存储为** | 下拉选择将读取内容存储为： 单个文本：将读取内容保存到一个文本中、 文本列表（每一行保存为列表的一项）：按行获取列表内容并存储到列表中 |
    | **文件编码**     | 下拉选择文件编码方式： 系统默认、 UTF-8、 ASCll、 UTF-8 Bom、 Unicode、 GBK、 GB2312     |
    | **保存文件内容至**  | 文本内容                                                                |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/y7Z2TvwRJJef-uiI/helpcenter/commands/os/images/getfilecontentcommand-02.png?fit=max&auto=format&n=y7Z2TvwRJJef-uiI&q=85&s=65116e2ca823461627c82d6e5cb17d07" alt="读取文本文件内容使用示例" width="976" height="149" data-path="helpcenter/commands/os/images/getfilecontentcommand-02.png" />

**该流程执行逻辑：**

使用【读取文本文件内容】指令读取指定文件的文本内容并将结果保存到文本内容

使用【打印日志】打印消息日志文本内容

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/y7Z2TvwRJJef-uiI/helpcenter/commands/os/images/getfilecontentcommand-03.png?fit=max&auto=format&n=y7Z2TvwRJJef-uiI&q=85&s=61247cf63ac7e05730a3a0d60e383901" alt="读取文本文件内容效果展示" width="359" height="106" data-path="helpcenter/commands/os/images/getfilecontentcommand-03.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/y7Z2TvwRJJef-uiI/helpcenter/commands/os/images/getfilecontentcommand-01.png?fit=max&auto=format&n=y7Z2TvwRJJef-uiI&q=85&s=911e1e263dad6dab5fddf2a127de8768" alt="读取文本文件内容效果展示" width="611" height="174" data-path="helpcenter/commands/os/images/getfilecontentcommand-01.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
