Learn R Programming

inpdfr (version 0.1.5)

preProcTxt: Extract text from txt files and pre-process content.

Description

Extract text from txt files and pre-process content.

Usage

preProcTxt(filetxt, encodingIn = "UTF-8", encodingOut = "UTF-8")

Arguments

filetxt

A character containing the name of a txt file.

encodingIn

Encoding of the text file (default = "UTF-8").

encodingOut

Encoding of the text extracted (default = "UTF-8").

Value

A character vector with the content of the pre-process txt file (one element per line).

Examples

Run this code
# NOT RUN {
data("loremIpsum")
subDir <- "RESULTS"
dir.create(file.path(getwd(), subDir), showWarnings = FALSE)
write(x = loremIpsum, file = "RESULTS/loremIpsum.txt")
preProcTxt(filetxt = paste0(getwd(), "/RESULTS/loremIpsum.txt"))
file.remove(list.files(pattern = "loremIpsum"))
# }

Run the code above in your browser using DataLab