Learn R Programming

flattabler (version 2.1.2)

read_text_folder: Import all text files in a folder

Description

Reads all text files in a folder and creates a list of pivot_table objects, one from each file. Each file is expected to contain a pivot table. Each line in a file corresponds to a row in a table; within each row, columns are defined by a separator character. File name is included as part of each object attributes.

Usage

read_text_folder(folder, sep = ";", encoding = "UTF-8")

Value

A pivot_table object list.

Arguments

folder

A string, folder name.

sep

Column separator character.

encoding

A string, encoding to be assumed for input strings.

Details

When multiple files are handled, the file name may contain information associated with the pivot table, it could be the table page information. In order not to lose this information, it is always stored in each pivot_table object.

See Also

pivot_table

Other import functions: read_excel_file(), read_excel_folder(), read_excel_sheet(), read_text_file()

Examples

Run this code

folder <- system.file("extdata", "csvfolder", package = "flattabler")
lpt <- read_text_folder(folder)

Run the code above in your browser using DataLab