
Extract all tables from a Word document
docx_extract_all_tbls(docx, guess_header = TRUE, preserve = FALSE, trim = TRUE)
docx
object read with read_docx
should the function make a guess as to the existence of
a header in a table? (Default: TRUE
)
preserve line breaks within a cell? Default: `FALSE`. NOTE: This overrides `trim`.
trim leading/trailing whitespace (if any) in cells? (default: TRUE
)
list
of data.frame
s or an empty list
if no
tables exist in docx
# NOT RUN {
# a "real" Word doc
real_world <- read_docx(system.file("examples/realworld.docx", package="docxtractr"))
docx_tbl_count(real_world)
# get all the tables
tbls <- docx_extract_all_tbls(real_world)
# }
Run the code above in your browser using DataLab