- Right-click a schema or table in the Database Explorer and choose Import/Export | Import Data from File(s), then pick one or more CSV files.
- Importing into a schema creates a new table; importing into an existing table appends the rows to it.
- Check First row is header, the delimiter format and each column type in the preview before you run the import.
- Write errors to file and Insert inconvertible values as null decide what happens to bad rows. Excel, JSON and Parquet files use the same dialog through data loaders.
A sample CSV file to practise with
To follow along, save the lines below as customers.csv (UTF-8). The file has a header row, a quoted value containing a comma and an empty value, which are the three things most likely to trip up a DataGrip import CSV run.
customer_id,name,email,country,signup_date
1,Amelia Clarke,amelia@example.com,United Kingdom,2026-01-15
2,"Ortiz, Daniel",daniel@example.com,Spain,2026-02-03
3,Priya Nair,,India,2026-02-20
4,Lukas Weber,lukas@example.com,Germany,2026-03-08Import a CSV file in DataGrip step by step
- In the Database Explorer, right-click the target schema (to create a new table) or an existing table (to add rows to it) and choose Import/Export | Import Data from File(s).
- Browse to the CSV file and select it. You can select several files at once.
- In the Import dialog, the mapping tree is on the upper left, settings on the upper right and a data preview at the bottom.
- Select the source file in the mapping tree and check its settings: Charset, Format, First row is header and Trim whitespaces. Adjust each column's Type if DataGrip guessed it wrongly.
- Select the mapping node and set the target Schema and Table. Type a new name to create a table, or choose an existing one.
- Review the column mapping (Target Column to Source Column) and the error options described below.
- Apply the changes and close the dialog to run the import.
A shortcut for the first two steps: drag the CSV file from DataGrip's Files tool window (Alt+2) onto a schema or table in the Database Explorer.
Settings that decide whether the import works
If your file uses semicolons, tabs or pipes, create or edit a format in the CSV Formats dialog. It lets you set the Value separator, Row separator, Null value text, the Quotation characters and escape method, and whether values are quoted. Its preview shows only the first 10 records.
| Setting | Where | What it does |
|---|---|---|
| First row is header | Source settings | Treats the first row as column names. Leave it off and the header is imported as data. |
| Charset | Source settings | The character set used to read the file. Match it to the file (for example UTF-8) to avoid garbled accents. |
| Format | Source settings | The delimiter format. The configure button opens the CSV Formats dialog. |
| Trim whitespaces | Source settings | Removes surrounding whitespace; when cleared, spaces are kept as part of the value. |
| Write errors to file | Mapping settings | Writes import errors to a text file so you can see which rows failed. |
| Insert inconvertible values as null | Mapping settings | Inserts NULL instead of failing when a value cannot be converted to the column type. |
| Disable indexes and triggers, lock table (may be faster) | Mapping settings | Speeds up large imports, but triggers do not fire. Only offered when the target table has indexes or triggers. |
Importing Excel, JSON and Parquet files
Other tabular files use the same Import Data from File(s) command. DataGrip reads them with scripted data loaders; the documented formats are Excel (.xlsx, .xls), JSON (.json), Parquet (.parquet) and Shapefile (.shp). You can also write your own loader in Groovy.
Two related options live in the same Import/Export menu: Copy Tables to, which copies tables between schemas or data sources through the same Import dialog, and the restore commands that run the database's own tools (mysql, pg_restore, psql, or bcp for SQL Server) for dump files rather than CSV.
When a CSV import goes wrong
- Column names imported as a data row: turn on First row is header.
- Values split in the wrong place: the delimiter or quotation setting does not match the file; fix the format and check the preview.
- Rows rejected for type errors: change the column type in the source settings, or enable Insert inconvertible values as null and clean up afterwards.
- Not sure which rows failed: enable Write errors to file and rerun into an empty table.
- Data appended to the wrong table: remember that dropping a file on an existing table adds rows to it.
Frequently asked questions
How do I import a CSV file into an existing table in DataGrip?
Right-click the table (not the schema) and choose Import/Export | Import Data from File(s), or drag the file onto the table. DataGrip adds the data to that table.
Can DataGrip create the table from a CSV file?
Yes. Import into a schema and DataGrip creates a new table; you can name it and adjust the column types in the Import dialog first.
Can DataGrip import a CSV with semicolons or tabs?
Yes. Choose or create a matching format in the CSV Formats dialog, where you set the value separator, quotation and NULL text.
Can DataGrip import Excel files?
Yes. .xlsx and .xls files are read by a built-in data loader through the same Import Data from File(s) command.
Can I import several CSV files at once?
Yes. Select several files in the file browser; each appears in the mapping tree of the Import dialog.
Sources
- DataGrip documentation: Import
- DataGrip documentation: Data extractors (CSV Formats dialog)
- DataGrip documentation: Data loaders
Checked 8 October 2026.
How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.