> ## Documentation Index
> Fetch the complete documentation index at: https://developer.voyado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contact CSV import

This is the structure of an example row in your CSV file:

| firstName | lastName    | email                                             | mobilePhone  | street           |
| --------- | ----------- | ------------------------------------------------- | ------------ | ---------------- |
| Example   | Examplesson | [example@example.com](mailto:example@example.com) | +46739111111 | Examplegatan 123 |

Read more about the manual import of contact data [in this guide](https://help.engage.voyado.com/hc/en-gb/articles/17245851011612-Import-contact-data-manually-to-Engage).

<Warning>
  You'll need to check your contacts data before importing it to Engage, to avoid problems later on. Read about the preparation process for a CSV import of contacts [on this page](https://help.engage.voyado.com/hc/en-gb/articles/17245864400924-Prepare-your-file-for-import).
</Warning>

You can download examples as CSV and Excel [on the example files page](/docs/file-based-transfer/example-files).

## Splitting your contacts CSV file

If a contacts CSV file has more than 50 000 records, you should split it into several files before importing them into Engage.

One way to do this is using a python script like this one:

```python expandable theme={null}
import csv
import os

def create_batches(input_file, output_folder, batch_size):
    # Create output folder if it doesn't exist
    if not os.path.exists(output_folder):
        os.makedirs(output_folder)

    with open(input_file, 'r', newline='') as csvfile:
        reader = csv.reader(csvfile)
        header = next(reader)

        batch_number = 1
        batch_count = 0
        output_csv = None

        for i, row in enumerate(reader):
            if i % batch_size == 0:
                if output_csv:
                    output_csv.close()
                output_file = os.path.join(output_folder, f'batch_{batch_number}.csv')
                output_csv = open(output_file, 'w', newline='')
                writer = csv.writer(output_csv)
                writer.writerow(header)
                batch_number += 1
                batch_count = 0

            writer.writerow(row)
            batch_count += 1

        if output_csv:
            output_csv.close()

if __name__ == "__main__":
    input_file = 'sample_data.csv'  # Here enter your CSV's file name
    output_folder = 'output_batches'  # Here write the output folder
    batch_size = 50000  # Here enter the number of rows per batch

    create_batches(input_file, output_folder, batch_size)
```

To use this script, do the following:

1. Make sure that Python 3 is installed on your computer.
2. Create a folder containing an empty text file called "script.py".
3. Copy the code above and paste it into that file.
4. Place the CSV you want to split into the same folder.
5. Open Command Prompt on PC (terminal in Mac) and navigate to this folder.
6. Run the script using the command "python script.py".
7. Now a folder should be created containing your files.
8. Take these files and import them into Engage.

## Importing your files

In the Engage frontend go to **Contacts** then **Import/Export** and then **Import**.

<Frame>
  <img src="https://mintcdn.com/voyado/racmXnTec926xsv9/images/contact-csv-import-01.png?fit=max&auto=format&n=racmXnTec926xsv9&q=85&s=df36b055be2d1fc169976b53224a2e76" alt="opt-out-import-02.png" width="388" height="510" data-path="images/contact-csv-import-01.png" />
</Frame>

You'll now see this page.

<Frame>
  <img src="https://mintcdn.com/voyado/racmXnTec926xsv9/images/contact-csv-import-02.png?fit=max&auto=format&n=racmXnTec926xsv9&q=85&s=c415c83d944ecf0d3087d3a41c9d71d1" alt="opt-out-import-04.png" width="981" height="645" data-path="images/contact-csv-import-02.png" />)
</Frame>

Hit "Browse" and select your CSV file. You can also drag-and-drop your file here.

Choose your contact type, separator, delimeter and encoding:

<Frame>
  <img src="https://mintcdn.com/voyado/racmXnTec926xsv9/images/contact-csv-import-03.png?fit=max&auto=format&n=racmXnTec926xsv9&q=85&s=b97d50e107bcf61adf903bf24ee07f20" alt="opt-out-import-05.png" width="967" height="826" data-path="images/contact-csv-import-03.png" />)
</Frame>

Make sure the attributes (the columns in your file) are matched to the attributes correctly.

You will be now presented with three import options.

<Frame>
  <img src="https://mintcdn.com/voyado/racmXnTec926xsv9/images/contact-csv-import-04.png?fit=max&auto=format&n=racmXnTec926xsv9&q=85&s=81438676c594fcf764d2d7e0374128f2" alt="opt-out-import-06.png" width="975" height="503" data-path="images/contact-csv-import-04.png" />)
</Frame>

* **Create and update:** If you're importing new contacts or a mix or old and new.
* **Only create new contacts:** If you're sure you're just creating new contacts.
* **Only Update:** If you're sure you're only updating existing contacts.

Choose your import and hit "Next":

<Frame>
  <img src="https://mintcdn.com/voyado/racmXnTec926xsv9/images/contact-csv-import-05.png?fit=max&auto=format&n=racmXnTec926xsv9&q=85&s=606c6c3a11c38e864626c66eb83d2f4f" alt="opt-out-import-07.png" width="979" height="271" data-path="images/contact-csv-import-05.png" />)
</Frame>

Now select "Import" to start your CSV import.

Obviously you'll need to repeat this for every individual contacts CSV file you have.
