Title: | Work with Microsoft Access Files |
---|---|
Description: | Use the open source 'MDB Tools' utilities <https://github.com/mdbtools/mdbtools/>. Primarily used for converting proprietary Microsoft Access files to simple text files and then reading those as data frames. |
Authors: | Kiernan Nicholls [aut, cre, cph]
|
Maintainer: | Kiernan Nicholls <[email protected]> |
License: | GPL-3 |
Version: | 0.2.1 |
Built: | 2025-02-04 04:54:57 UTC |
Source: | https://github.com/k5cents/mdbr |
Convert the data of a table into a delimited text string. Save the string as a character vector or write it to a text file. This direct conversion makes it easy to read tables into R or a spreadsheet.
export_mdb( file, table, output = TRUE, delim = ",", quote = "\"", quote_escape = "double", col_names = TRUE, eol = "\n", date_format = "%Y-%m-%d %H:%M:%S" )
export_mdb( file, table, output = TRUE, delim = ",", quote = "\"", quote_escape = "double", col_names = TRUE, eol = "\n", date_format = "%Y-%m-%d %H:%M:%S" )
file |
Path to the Microsoft Access file. |
table |
Name of the table, list with |
output |
Path or connection to write to. Passed to the |
delim |
Delimiter used to separate values. |
quote |
Single character used to quote strings. Defaults to |
quote_escape |
The type of escaping to use for quoted values, one of
|
col_names |
If |
eol |
The end of line character to use. Most commonly either |
date_format |
The format in which date columns are converted. MDB Tools
uses the |
Character string, invisible if path to file.
## Not run: export_mdb(mdb_example(), "Airlines", output = TRUE) ## End(Not run)
## Not run: export_mdb(mdb_example(), "Airlines", output = TRUE) ## End(Not run)
mdbr comes bundled with a sample file from the nycflights13 package in its inst/extdata directory. This function make it easy to access.
mdb_example(path = "nycflights13.mdb")
mdb_example(path = "nycflights13.mdb")
path |
path to the Microsoft Access file. |
Used to determine the column types for read_mdb()
. Passed to col_types
in readr::read_delim()
.
mdb_schema(file, table, condense = FALSE)
mdb_schema(file, table, condense = FALSE)
file |
Path to the Microsoft Access file. |
table |
Name of the table, list with |
condense |
Should |
A readr cols specification list.
## Not run: mdb_schema(mdb_example(), "Flights", condense = TRUE) ## End(Not run)
## Not run: mdb_schema(mdb_example(), "Flights", condense = TRUE) ## End(Not run)
List tables in a Microsoft Access database
mdb_tables(file)
mdb_tables(file)
file |
Path to the Microsoft Access file. |
A character vector of table names.
Use export_mdb()
to write a table as a temporary CSV file, which is then
read as a data frame using readr::read_delim()
.
read_mdb(file, table, col_names = TRUE, col_types = NULL, ...)
read_mdb(file, table, col_names = TRUE, col_types = NULL, ...)
file |
Path to the Microsoft Access file. |
table |
Name of the table, list with |
col_names |
Whether or not to suppress column names from the table. |
col_types |
One of |
... |
Additional arguments passed to |
A data frame.
## Not run: read_mdb(mdb_example(), "Airlines") ## End(Not run)
## Not run: read_mdb(mdb_example(), "Airlines") ## End(Not run)