read_text_file: Import text file

View source: R/read_text.R

read_text_fileR Documentation

Import text file

Description

Reads a text file and creates a pivot_table object. The file is expected to contain one or more pivot tables. Each line in the file corresponds to a row in a table; within each row, columns are defined by a separator character. The file name is included as part of the object attributes.

Usage

read_text_file(file, sep = ";", encoding = "UTF-8", define_page = TRUE)

Arguments

file

A string, name of a text file.

sep

Column separator character.

encoding

A string, encoding to be assumed for input strings.

define_page

A boolean, include file name as pivot_table page definition.

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 can be stored in the pivot_table object.

Value

A pivot_table object.

See Also

pivot_table

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

Examples


# file <- system.file("extdata", "csvfolder/m4.csv", package = "flattabler")
# pt <- read_text_file(file)


flattabler documentation built on Sept. 15, 2023, 1:06 a.m.