% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read.R
\name{tl_read_dir}
\alias{tl_read_dir}
\title{Read all matching files from a directory}
\usage{
tl_read_dir(
  path,
  pattern = NULL,
  format = NULL,
  recursive = FALSE,
  .quiet = FALSE,
  ...
)
}
\arguments{
\item{path}{Path to a directory.}

\item{pattern}{Optional regex pattern to filter file names (e.g.,
\code{"sales_.*\\\\.csv$"}). If \code{NULL}, files are filtered by
\code{format} instead.}

\item{format}{File format to read. If \code{NULL} and \code{pattern} is
\code{NULL}, all recognized data files are read. If specified, only files
with matching extensions are read.}

\item{recursive}{Logical. Should subdirectories be scanned? Default is
\code{FALSE}.}

\item{.quiet}{Suppress messages. Default is \code{FALSE}.}

\item{...}{Additional arguments passed to the format-specific reader.}
}
\value{
A \code{tidylearn_data} object with an additional
\code{source_file} column identifying the origin of each row.
}
\description{
Scans a directory for files matching a pattern or format, reads each one,
and row-binds them into a single \code{tidylearn_data} object with a
\code{source_file} column identifying the origin of each row.
}
\examples{
\donttest{
# Read all CSVs from a directory
# data <- tl_read_dir("data/", format = "csv")

# Read with pattern matching
# data <- tl_read_dir("data/", pattern = "^sales_.*\\.csv$")

# Read all recognized data files recursively
# data <- tl_read_dir("data/", recursive = TRUE)
}

}
