Parse a CSV file's header, if present.

parse_csv_header(obj, filename, header, enforce_requirements = TRUE)

Arguments

obj

The object to attach attributes to

filename

Fully-qualified filename

header

A vector of strings comprising the file header

enforce_requirements

Enforce mandatory fields?

Value

An empty tibble with appropriate attributes filled in.

Details

Headers are given at the top of files and consist of labels ("Title:", "Units:", etc) prefixed by comment characters (#). The parser looks for these, and calls add_title and similar functions to return an empty data frame with appropriate attribute set.