# Convert Thing to Table

### Overview

Converts a specified thing, such as a CSV file or JSON, into a table. Only CSV files (and JSON if new\_json is enabled) are supported for conversion.

### Syntax

```
convert the csv to a table
```

or

```
convert <the thing> to a table
```

Where *the thing* is replaced by a reference to a CSV or JSON object.

### Parameters

* **thing** (required): The object to be converted into a table. Must be a CSV file or JSON object.

### Returns

A table created from the CSV or JSON data.

### Examples

#### Example 1: Convert CSV File to Table

```
the csv
convert the csv to a table
```

**Result**: Table created from CSV file contents

Expected table structure:

| Name       | Age | Salary   | City        |
| ---------- | --- | -------- | ----------- |
| John Doe   | 30  | 50000.5  | New York    |
| Jane Smith | 25  | 45000.75 | Los Angeles |
| ...        | ... | ...      | ...         |

#### Example 2: Convert CSV String to Table

```
create a sample table
convert the table to a csv
convert the csv to a table
```

**Result**: Round-trip conversion - table → CSV → table preserves data

#### Example 3: Convert JSON to Table (with new\_json enabled)

```
the foos is [{"name": "Obj 0", "val": "val 0"}, {"name": "Obj 1", "val": "val 1"}]
the foos is a json
convert the foos to a table
```

**Result**: Table with columns "name" and "val"

| name  | val   |
| ----- | ----- |
| Obj 0 | val 0 |
| Obj 1 | val 1 |

#### Example 4: Convert Single JSON Object to Table

```
the person is {"name": "Alice", "age": 30, "city": "NYC"}
the person is a json
convert the person to a table
```

**Result**: Single-row table

| name  | age | city |
| ----- | --- | ---- |
| Alice | 30  | NYC  |
