Learn R Programming

ReporteRs (version 0.8.10)

text_extract: Simple Text Extraction From a Word Document

Description

Provides a simple method to get text from a docx document. It returns a character vector containing all chunk of text found in the document.

Usage

text_extract(x, body = TRUE, header = TRUE, footer = TRUE, bookmark)

Arguments

x

docx object

body

specifies to scan document body

header

specifies to scan document header

footer

specifies to scan document footer

bookmark

a character value ; id of the Word bookmark to scan.

Value

a character vector

See Also

docx, list_bookmarks

Examples

Run this code
# NOT RUN {
doc <- docx( title = "My example", template = file.path(
  system.file(package = "ReporteRs"), "templates/bookmark_example.docx") )
text_extract( doc )
text_extract( doc, header = FALSE, footer = FALSE )
text_extract( doc, bookmark = "author" )
# }

Run the code above in your browser using DataLab