Convert Text to Tidy-Text Format
read_text.Rd
This function takes a character string or a path to a text file as input and converts it to tidy-text format. The resulting tibble contains one row for each line of the input text, along with the file name, and line number.
Value
A tibble containing the converted text in tidy-text format, with columns for the text, file name, line number, and batch index (if applicable).
Examples
read_text("Hello, how are you?")
#> # A tibble: 1 × 4
#> text file line batch_index
#> <chr> <chr> <int> <dbl>
#> 1 Hello, how are you? character string 1 1
read_text("path/to/text/file.txt")
#> # A tibble: 1 × 4
#> text file line batch_index
#> <chr> <chr> <int> <dbl>
#> 1 path/to/text/file.txt character string 1 1