File: stri_read_lines.Rd

package info (click to toggle)
r-cran-stringi 1.7.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 39,772 kB
  • sloc: cpp: 482,349; ansic: 51,900; perl: 471; makefile: 9; sh: 1
file content (52 lines) | stat: -rw-r--r-- 1,756 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/files.R
\name{stri_read_lines}
\alias{stri_read_lines}
\title{Read Text Lines from a Text File}
\usage{
stri_read_lines(con, encoding = NULL, fname = con, fallback_encoding = NULL)
}
\arguments{
\item{con}{name of the output file or a connection object
(opened in the binary mode)}

\item{encoding}{single string; input encoding;
\code{NULL} or \code{''} for the current default encoding.}

\item{fname}{deprecated alias of \code{con}}

\item{fallback_encoding}{deprecated argument, no longer used}
}
\value{
Returns a character vector, each text line is a separate string.
The output is always marked as UTF-8.
}
\description{
Reads a text file in ins entirety, re-encodes it, and splits it into text lines.
}
\details{
This aims to be a substitute for the \code{\link{readLines}} function,
with the ability to re-encode the input file in a much more robust way,
and split the text into lines with \code{\link{stri_split_lines1}}
(which conforms with the Unicode guidelines for newline markers).

The function calls \code{\link{stri_read_raw}},
\code{\link{stri_encode}}, and \code{\link{stri_split_lines1}},
in this order.

Because of the way this function is currently implemented,
maximal file size cannot exceed ~0.67 GB.
}
\seealso{
The official online manual of \pkg{stringi} at \url{https://stringi.gagolewski.com/}

Gagolewski M., \pkg{stringi}: Fast and portable character string processing in R, \emph{Journal of Statistical Software} 103(2), 2022, 1-59, \doi{10.18637/jss.v103.i02}

Other files: 
\code{\link{stri_read_raw}()},
\code{\link{stri_write_lines}()}
}
\concept{files}
\author{
\href{https://www.gagolewski.com/}{Marek Gagolewski} and other contributors
}