# Get a Table from a File

### 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](https://docs.kognitos.com/excel/worksheets/get-a-worksheet) followed by [Get the Worksheet's Table](https://docs.kognitos.com/excel/worksheets/get-an-item-from-an-excel-worksheet) 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
```


---

# 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://docs.kognitos.com/legacy/legacy-experience/automation-areas/tables-v2/create-a-table/get-a-table-from-a-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.
