Import CSV and TSV files into a table
Load one or several delimited files into an existing table, with a preview before anything is written.
Datark imports CSV and TSV files into an existing table on a SQL engine. Each file can be up to 100 MB. You can pick several files to import one after another with the same settings, as long as they have the same columns.
Before you start
- Create the table first. Import adds rows to a table; it does not create one from the file.
- The connection must not be read-only, and the target must be a table, not a view.
- Finish any open transaction in the query editor for that connection. Import is unavailable while one is open.
On Mac
- Connect and open the table in Browse.
- Choose Import / Export in the toolbar, then the Import tab.
- Choose Choose File and pick one or more files.
- Under File interpretation, set First row is header, the Delimiter, whether to Skip invalid rows, and how Empty fields are read: as an empty string or as SQL NULL.
- Under Column mapping, match each source column to a target column, or choose Skip. Map at least one column.
- Check the Validation preview. It shows how many rows are ready and how many are invalid.
- Choose Import.
On iPhone and iPad
- Connect, open the table in Browse, and open the export and import sheet.
- Choose the Import tab and pick your file or files.
- Set the delimiter, whether the first row is a header, the text encoding (UTF-8 or Windows-1252), and whether to skip invalid rows.
- Choose Import Rows to confirm.
What to expect
- Several files run one after another, each in its own transaction. If a file fails, Datark stops there and tells you which files were imported and which were not.
- If you cancel, the file being imported is rolled back and nothing from it is written.
- With Skip invalid rows on, rows that fail validation are skipped and counted; the result lists the first skipped rows.
- If the database does not confirm the outcome of a file, check the table before importing that file again.
- Import requires a SQL table. MongoDB document editing in 1.1 does not add CSV or TSV import, and Redis is read-only in the grid.
For the other direction, see Import and export.
Download Datark. It's free.
Free for Mac, iPhone and iPad. No account required.