> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/export-text-to-file.md).

# export-text-to-file

## Description

<mark style="color:purple;">`export-text-to-file`</mark> *adaptor takes text data as input and saves it to a file*.

By default the file is encoded using `utf-8` if no encoding is specified.

## Inputs

**`text`**\
Type: `text`\
Required: Yes\
The text to be exported as a file.

**`encoding`**\
Type: `text`\
Required: No\
The character encoding of the exported text file. If unspecified, defaults to `utf8`.

**`output file name`**\
Type: `text`\
Required: No\
The name of the output file. If unspecified, defaults to `file.txt`.

## Outputs

**`file`**\
Type: `file`\
The exported text file.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`text:` Hello World

`encoding` *null (empty)*

`output file name:` *null (empty)*

#### Outputs:

`file:` file.txt

```
Hello World
```

-> Created the file `file.txt` containing the text `Hello World` using default encoding.

### Example 2: Specify encoding and file name.

#### Inputs:

`text:` Hello World

`encoding` base64

`output file name:` hello-world.txt

#### Outputs:

`file:` hello-world.txt

```
Èe°j+ï
```

-> Created the file `hello-world.txt` containing the text `Hello World` using 'base64' encoding.
