mdb-export(1)

mdb-export1

Export data in an mdb database table to csv format.

Usage

mdb-export [--no-header] [--delimiter delim] [--row-delimiter delim] [{[--no-quote] | [--quote char [--escape char]]}] [--escape-invisible] [--date-format fmt] [--datetime-format fmt] [{--bin strip | raw | octal | hex}] [--boolean-words] database table

mdb-export --insert backend [--namespace prefix] [--batch-size int] database table

mdb-export {-h | --help}

mdb-export --version

Overview

mdb-export is a utility program distributed with MDB Tools.

It produces a CSV (comma separated value) output for the given table. Such output is suitable for importation into databases or spreadsheets.

Used with --insert, it outputs SQL specific to backend dialect, including some constraints like NOT NULL and foreign keys.

Options

-H, --no-header

Suppress header row.

-d, --delimiter delim

Specify an alternative column delimiter. Default is , (comma).

-R, --row-delimiter delim

Specify a row delimiter. Default is \n (ASCII value 10).

-Q, --no-quote

Don't wrap text-like fields (text, memo, date) in quotes. If not specified text fiels will be surrounded by " (double quote) characters.

-q, --quote char

Use char to wrap text-like fields. Default is " (double quote).

-X, --escape char

Use char to escape quoted characters within a field. Default is doubling.

-e, --escape-invisible

Use C-style escaping for return (\r), tab (\t), line-feed (\n), and back-slash (\\) characters. Default is to leave as they are.

-I, --insert backend

INSERT statements (instead of CSV). You must specify which SQL backend dialect to use. Allowed values are: access, sybase, oracle, postgres, mysql and sqlite.

-N, --namespace prefix

Prefix identifiers with prefix.

-S, --batch-size int

Size of insert batches on supported platforms.

-D, --date-format fmt

Set the date format (see strftime(3) for details.

-T, --datetime-format fmt

Set the date/time format (see strftime(3) for details.

-0, --null char

Use char to represent a NULL value. -b, --bin strip|raw|octal|hex Binary export mode: strip binaries, export as-is, output \ooo style octal data or output \xx style hexadecimal data.

-B, --boolean-words

Use TRUE/FALSE in Boolean fields (default is 0/1).

--version

Print the mdbtools version and exit.

Notes

Most of the formatting options actually also works with --insert.

Environment

MDB_JET3_CHARSET

Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1).

MDBICONV

Defines the output charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv.

MDBOPTS

Colon-separated list of options:

•

debug_like

•

debug_write

•

debug_usage

•

debug_ole

•

debug_row

•

debug_props

•

debug_all is a shortcut for all debug_* options

•

no_memo (deprecated; has no effect)

•

use_index (experimental; requires libmswstr)

Releases

11 releases since Debian 3.1 (Sarge); the text changed 9 times.

  1. 3.1
  2. 4.0–5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13

--batch-size since Debian 11 (Bullseye); --boolean-words since Debian 11 (Bullseye); --date-format since Debian 11 (Bullseye); --datetime-format since Debian 11 (Bullseye); --delimiter since Debian 11 (Bullseye); --escape since Debian 11 (Bullseye); --escape-invisible since Debian 11 (Bullseye); --insert since Debian 11 (Bullseye); --namespace since Debian 11 (Bullseye); --no-header since Debian 11 (Bullseye); --no-quote since Debian 11 (Bullseye); --null since Debian 11 (Bullseye); --quote since Debian 11 (Bullseye); --row-delimiter since Debian 11 (Bullseye); --version since Debian 12 (Bookworm); -0 since Debian 11 (Bullseye); -B since Debian 11 (Bullseye); -D since Debian 4.0 (Etch); -I since Debian 4.0 (Etch); -N since Debian 7 (Wheezy); -R since Debian 4.0 (Etch); -S since Debian 11 (Bullseye); -T since Debian 11 (Bullseye); -X since Debian 4.0 (Etch); -e since Debian 11 (Bullseye); -q since Debian 4.0 (Etch).

-b until Debian 10 (Buster).

History

mdb-export first appeared in MDB Tools 0.1.

Authors

The mdb-export utility was written by Brian Bruns.

Bugs

Memo fields are allowed to contain a newline characters, the current program does nothing about this.

From mdbtools 1.0.1-0.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.