Skip to content

CSV

ingestr supports CSV files as source and destination. This allows copying data from any database into a local CSV file, as well as uploading data from the local CSV files into database tables.

URI format

The URI format for CSV files is as follows:

plaintext
csv://path/to/csv/file.csv

Character encoding

ingestr handles UTF-8 (with or without BOM) and UTF-16 LE/BE (with BOM) automatically. If your file is in a different encoding and you see garbled characters ( or wrong letters) in the destination, declare the encoding via the encoding query parameter:

plaintext
csv:///path/to/file.csv?encoding=windows-1252

To check what encoding your file actually is, inspect the first bytes:

sh
head -c 4 your_file.csv | xxd
First bytesEncodingAction
efbb bfUTF-8 with BOMNone (auto-detected)
fffeUTF-16 LENone (auto-detected)
feffUTF-16 BENone (auto-detected)
fffe 0000UTF-32 LE?encoding=utf-32le
0000 feffUTF-32 BE?encoding=utf-32be
ASCII-like bytesUTF-8 or some 8-bit encodingTry without param; if you see , declare it (most often windows-1252)

Common encoding values: windows-1252 / cp1252, iso-8859-1 / latin1, windows-1250, windows-1251, shift_jis, gb18030, euc-kr. Names follow the WHATWG Encoding Standard (case-insensitive). Unknown names return an error.