> 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/automate-en/action-guides/file-and-folder/file-append-line.md).

# File append line

File append line is the action used to insert a new line of text at the end of a `.txt` file.

Unlike the overwrite action (File write all text), this action helps preserve all existing data in the file.

* If the file does not exist: The system will automatically create a new `.txt` file at the specified path and then proceed to insert the line of text.
* If the file already exists: The system retains the old content, automatically adds a new line at the end of the file, and appends the new line of data.

#### Configuration parameters:

* File Path: The absolute path to the `.txt` file where you want to append data (e.g., `D:\GPM\history_log.txt`).
* Text: The content of the text (or a variable containing the text) that you want to append to the end of the file.

#### Practical example: Logging successful accounts

Suppose you run an interactive script and want to save the list of accounts that have completed the task into the `success_accounts.txt` file for easy checking at the end of the day:

* Configuration method: After the account has completed the interactive steps at the end of the script, you call the File append line action:
  * File Path: Enter `D:\GPM\success_accounts.txt`.
  * Text: Pass the variable containing the account name (e.g., `$currentAccount`).
* Result: Each time a run is completed, the account name will be neatly appended as separate lines in the `success_accounts.txt` file (e.g., line 1 is `tk_01`, line 2 is `tk_02`...) without losing data from previously run accounts.

<figure><img src="/files/QUHtkpKeGH1T8K7AtYkd" 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/automate-en/action-guides/file-and-folder/file-append-line.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.
