> For the complete documentation index, see [llms.txt](https://docs.kognitos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kognitos.com/legacy/legacy-experience/automation-areas/tables-v2/create-a-table/get-a-table-from-a-file.md).

# Get a Table from a File

Opens a table from a file, provided either through direct upload or at an S3 URL.

### Overview

This procedure imports a table from a file, which can be provided via direct upload to Kognitos or fetched from an S3 URL. It supports popular file formats such as CSV and Excel.

{% hint style="info" %}
It is recommended to use [Get the Worksheet](/legacy/legacy-experience/automation-areas/excel-v2/get-a-worksheet.md) followed by [Get the Worksheet's Table](/legacy/legacy-experience/automation-areas/excel-v2/get-a-worksheet/get-an-item-from-an-excel-worksheet.md) when extracting tables from **Excel** files.
{% endhint %}

### Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

<details>

<summary><code>the file</code></summary>

#### What does it do?

Specifies the file to extract the table from.

#### Where does it go?

This phrase should be written on a **new line**.

#### Is it required?

✅ Yes — This phrase is **required**.

#### Does it require data?

✅ Yes — Either specify an S3 url using **is** or leave this line as "the file" to raise an exception prompting a local file upload.

#### Example

```
the file is "s3://my-bucket/data/table.xlsx"
```

</details>

<details>

<summary><code>open the table at the file</code></summary>

#### What does it do?

Instructs the system to extract the table at the provided file.

#### Where does it go?

This phrase should be written on a **new line**.

#### Is it required?

✅ Yes — This phrase is **required**.

#### Does it require data?

✅ Yes — Requires **the file** to be defined in the previous line.

</details>

### Examples

#### 1. Uploading a File Directly

Here, `the file` will raise a question prompting you to upload a file directly.

```
the file
open the table at the file
```

#### 2. Specifying an S3 URL

In this example, `the file` is provided as an S3 URL.

```
the file is "s3://my-bucket/data/table.xlsx"
open a table at the file
```
