# import-from-excel-file

## Description

<mark style="color:purple;">`import-from-excel-file`</mark> *adaptor imports data from an Excel file in XLSX format*.

## Inputs

**`file`**\
Type: `file`\
Required: Yes\
The spreadsheet file in Office Open XML SpreadsheetML file format (`.xlsx`).

**`sheet name`**\
Type: `text`\
Required: No\
The name of the sheet (tab) from which to import the data. If unspecified, the first sheet will be used.

**`range`**\
Type: `text`\
Required: No\
A valid range of cells (e.g., `A1:L512`) that contain data. If unspecified, the entire sheet will be included.

**`skip`**\
Type: `list`\
Required: No\
A list of row numbers to be ignored. If unspecified, then all rows in the range will be imported.

## Outputs

**`data`**\
Type: `datatable`\
A datatable containing the imported data.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`file:` data.xlsx

`sheet name:` *null (empty)*

`range:` *null (empty)*

`skip:` *null (empty)*

#### Outputs:

`data`:

| id       | latitude    | longitude    |
| -------- | ----------- | ------------ |
| Sample A | 4.642276772 | -8.17536836  |
| Sample B | 5.063345736 | -9.051186684 |
| Sample C | 5.063345736 | -9.051186684 |
| Sample D | 4.638091468 | -8.17536836  |

-> Imported the excel file `data.xlsx` into Data-flo.

### Example 2: Import data from excel file within a specified range.

#### Inputs:

`file:` data.xlsx

`sheet name:` Sheet1

`range:` A1:C4

`skip:` *null (empty)*

#### Outputs:

`data`:

| id       | latitude    | longitude    |
| -------- | ----------- | ------------ |
| Sample A | 4.642276772 | -8.17536836  |
| Sample B | 5.063345736 | -9.051186684 |
| Sample C | 5.063345736 | -9.051186684 |

-> Imported the excel file `data.xlsx` from cell range A1:C4.

### Example 3: Import data from excel file `data.xlsx`, skipping specific rows.

#### Inputs:

`file:` data.xlsx

`sheet name:` Sheet1

`range:` *null (empty)*

`skip:`

1. 2
2. 4

#### Outputs:

`data`:

| id       | latitude    | longitude    |
| -------- | ----------- | ------------ |
| Sample A | 4.642276772 | -8.17536836  |
| Sample C | 5.063345736 | -9.051186684 |

-> Imported the excel file `data.xlsx` and skipped rows `2` and `4`.
