knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

CRAN status Build Status AppVeyor Build Status R-CMD-check CircleCI build status

striprtf: Extract Text from RTF (Rich Text Format) File

Installation

This package is now on CRAN.

install.packages("striprtf")

Alternatively, install development version from Github using devtools library.

devtools::install_github("kota7/striprtf")

Usage

The package exports two main functions:

library(striprtf)
x <- read_rtf(system.file("extdata/king.rtf", package = "striprtf"))
head(x)

The package has also been tested with documents in East Asian languages.

read_rtf(system.file("extdata/amenimo.rtf", package = "striprtf"))
read_rtf(system.file("extdata/mean.rtf", package = "striprtf"))

Important Change in the Function Names

From ver 0.3.1, the functions are renamed as follows:

See NEWS for other updates.

Tables (v0.4.1+)

Supports tables in documents. Use row_start, row_end, cell_end arguments to adjust the format the tables. Suppports line breaks (and other special characters) within cells.

The parser is made robust from v0.4.5.
Tested with files generated by Microsoft Word, Google Doc, and Libre Office Writer.

# example file added at v0.4.2
read_rtf(system.file("extdata/shakespeare.rtf", package = "striprtf"),
         row_start = "**", row_end = "", cell_end = " --- ")

Note:

References



kota7/striprtf documentation built on Aug. 21, 2023, 6:49 p.m.