# 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.


---

# Agent Instructions: 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:

```
GET https://cgps.gitbook.io/data-flo/reference-guide/export-text-to-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
