mdb-export is a utility program distributed with MDB Tools. It produces CSV output for the given table. Such output is suitable for importation into databases or spreadsheets.

mdb_export(
  path,
  table,
  no_header = FALSE,
  delimiter = ",",
  row_delimiter = "\n",
  no_quote = FALSE,
  quote = "\"",
  escape = NULL,
  escape_invisible = FALSE,
  date_format = "%Y-%m-%d",
  datetime_format = "%Y-%m-%d %H:%M:%S",
  null = "",
  bin = c("strip", "raw", "octal", "hex"),
  boolean_words = FALSE,
  insert = NULL,
  namespace = NULL,
  batch_size = 1L,
  n = -1L
)

Arguments

path

Path to .mdb/.accdb file.

table

Table name.

no_header

Logical, equivalent to -H/--no-header.

delimiter

Equivalent to -d/--delimiter.

row_delimiter

Equivalent to -R/--row-delimiter.

no_quote

Equivalent to -Q/--no-quote.

quote

Equivalent to -q/--quote.

escape

Equivalent to -X/--escape.

escape_invisible

Equivalent to -e/--escape-invisible.

date_format

Equivalent to -D/--date-format.

datetime_format

Equivalent to -T/--datetime-format.

null

Equivalent to -0/--null.

bin

Binary mode (strip, raw, octal, hex) for parity.

boolean_words

Equivalent to -B/--boolean-words.

insert

Backend for -I/--insert mode.

namespace

Equivalent to -N/--namespace.

batch_size

Equivalent to -S/--batch-size.

n

Optional row limit (LIMIT n).

Value

Character scalar containing CSV or SQL INSERT text.

Details

Used with insert, it outputs backend-specific SQL INSERT statements. Most formatting options also apply in insert mode.

Examples

db <- mdbr:::.mdb_example_nwind_path()
if (nzchar(db)) {
  cat(mdb_export(db, "Products", n = 2))
}