# import-list-from-text-file

<mark style="color:purple;">`import-list-from-text-file`</mark> *adaptor imports a list from a text file*.

The character encoding can be changed using the encoding option in the adaptor, if unspecified defaults to utf8 encoding

## Inputs

**`file`**\
Type: `file`\
Required: Yes\
The text file to be converted.

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

**`separator`**\
Type: `text`\
Required: No\
Character used as a line separator. If unspecified, defaults to (newline).

**`trim`**\
Type: `boolean`\
Required: No\
Specifies whether to ignore whitespace characters immediately around the separator. If unspecified, defaults to `True`.

## Outputs

**`list`**\
Type: `list`\
A list of values.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`file:` example.txt

```
January
February
March
April
```

`encoding:` *null (empty)*

`separator:` *null (empty)*

`trim:` *null (empty)*

#### Outputs:

`list`:

1. January
2. February
3. March
4. April

-> Imported a list from the text file `example.txt` into Data-flo.

### Example 2: Import list from text file with a `,` separator.

#### Inputs:

`file:` example.txt

```
January, February, March, April
```

`encoding:` *null (empty)*

`separator:` ,

`trim:` *null (empty)*

#### Outputs:

`list`:

1. January
2. February
3. March
4. April

-> Imported a comma separated list from the text file `example.txt` into Data-flo.


---

# 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/import-list-from-text-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.
