# Excel Quick Load

## Data Load

Need to take your Excel data and load it into your database to get the analysts started?  &#x20;

Instead of taking weeks to develop a new data pipeline, create structure, and work with the business to load your new client data in, just drop the file in Perigee. We will take care of everything from finding and getting the data loaded, to creating a table in only a few seconds. You’ll be a hero!  &#x20;

#### The Data

Here's a typical messed up Excel file where data is shifted and there are unwanted headers.&#x20;

<div data-full-width="true"><figure><img src="/files/vfoBsYX8YuRFvsIeXJWu" alt="Excel window showing misaligned data"><figcaption></figcaption></figure></div>

#### The Code

```csharp
using Microsoft.Extensions.Logging;
using Perigee;
using Perigee.Database.MSSQL;
using Perigee.FileFormats.Excel;
using System.Data;

// Visit https://docs.perigee.software to learn more
// Visit https://perigee.software to purchase a license!
PerigeeApplication.App("Excel Load", (c) =>
{
    //Register the "main" connection string to a credential called MSSQL.
    c.RegisterConnectionString("MSSQL", "main");
    
    c.Add("ReadFile", (ct, l) =>
    {
        //Get data from file, sheet 1.
        var tbl = Transformer.TableFromFile("SampleExcel.xlsx", sheetIndex: 1);
        tbl.TableName = "ClientData";
        
        //Load into SQL
        tbl.ProcessToSQL("MSSQL");

        //run once. 
        while (PerigeeApplication.delayOrCancel(10000, ct)) {}
    });
});
```

Taking a peak at our database, we see the data loaded into our new table **`dbo.clientData`**:

<div data-full-width="true"><figure><img src="/files/nJDTKORPGmzk4NFNaxp8" alt=""><figcaption></figcaption></figure></div>

Which came directly from the Excel file linked below

### The associated files:

The <mark style="color:orange;">**`appsettings.json`**</mark> file:

```json
{
  "ConnectionStrings": {
    "main": "data source=host; initial catalog=test; User Id=sa; Password=abc"
  },
  "AppSettings": {
  
  },
  "Perigee": { "HideConsole": false },
  "Serilog": {
    "MinimumLevel": "Debug",
    "WriteTo": [
      { "Name": "Console" }
    ]
  }
}
```

The <mark style="color:orange;">**`SampleExcel`**</mark> file we loaded:

{% file src="/files/nNseCS4IvJLN1gYFhar7" %}


---

# 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.perigee.software/examples-and-demos/excel-quick-load.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.
