> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-read-all-text.md).

# File read all text

File read all text là hành động dùng để đọc trọn vẹn nội dung của một file văn bản định dạng `.txt` cùng một lúc. Toàn bộ dữ liệu bên trong file sẽ được trả về dưới dạng một chuỗi văn bản (string) duy nhất và lưu vào một biến đầu ra (Output variable).

🎥 Xem thêm video hướng dẫn: [Tại đây](https://youtu.be/EH7olDLAb9c).

#### Tham số cấu hình:

* File Path: Đường dẫn tuyệt đối dẫn đến file `.txt` cần đọc (Ví dụ: `D:\data\content.txt`).
* Output variable: Tên biến lưu cấu trúc chuỗi ký tự vừa đọc được.

#### Ví dụ thực tế: Đọc nội dung bài viết chuẩn bị sẵn

Giả sử bạn chuẩn bị một bài viết dài (gồm nhiều câu, dấu xuống dòng, khoảng trắng) lưu trong file văn bản `D:\GPM\post.txt`. Bạn muốn lấy toàn bộ nội dung này để tự động điền vào ô đăng bài trên trình duyệt:

* Cách cấu hình:
  * File Path: Điền đường dẫn `D:\GPM\post.txt`
  * Output variable: Đặt tên biến lưu kết quả là `$textContent`.
* Kết quả: Hệ thống sẽ bốc trọn vẹn mọi ký tự và cấu trúc dòng có trong file gán vào biến `$textContent`. Ở các bước tiếp theo, bạn chỉ cần gọi hành động Key press truyền biến `$textContent` này vào ô nhập liệu của website là xong.

<figure><img src="/files/3saX6sUcg3xVmpG68jv1" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-read-all-text.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
