# AppendLine

> Appends the specified string to a file, creating the file if it does not already exist.

Appends the specified string to a file, creating the file if it does not already exist.

## Definition

**Namespace:** UiPath.Activities.System.API

**Assembly:** UiPath.System.Activities.Api (in UiPath.System.Activities.Api.dll)

## Overloads

|  |  |
| --- | --- |
| `AppendLine(String, ILocalResource)` | Appends the specified string to a file, creating the file if it does not already exist. |
| `AppendLine(String, ILocalResource, Boolean, String)` | Appends the specified string to a file, along with other configurations, creating the file if it does not already exist. |

## `AppendLine(String, ILocalResource)`

Appends the specified string to a file, creating the file if it does not already exist.

```
void AppendLine(
    string text,
    ILocalResource file
)
```

`text` [String](https://learn.microsoft.com/dotnet/api/system.string) : The text to be appended to the file.

`file ILocalResource` : The file to append the line to.

## `AppendLine(String, ILocalResource, Boolean, String)`

Appends the specified string to a file, along with other configurations, creating the file if it does not already exist.

```
void AppendLine(
    string text,
    ILocalResource file,
    bool useDefaultEncoding,
    string encoding
)
```

`text` [String](https://learn.microsoft.com/dotnet/api/system.string) : The text to be appended to the file.

`file ILocalResource` : The path of the file to append the line to. If the path is not full, the file is created in the project folder.

`useDefaultEncoding` [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) : Use the default operating system encoding is used when a new file is created or when the encoding cannot be detected. If not selected, the UTF-8 encoding is used.

`encoding` [String](https://learn.microsoft.com/dotnet/api/system.string) : The encoding type to be used. You can find the complete list of codes for each character encoding [here](https://docs.uipath.com/activities/other/latest/user-guide/supported-character-encoding). If no encoding type is specified, the activity will search for the file's Byte Order Marks to detect the encoding. If no Byte Order Marks are detected and **Use default encoding** is not used, UTF-8 will be used by default.
