extract_header_info: extract_header_info

View source: R/utils.R

extract_header_infoR Documentation

extract_header_info

Description

Extract information from CSV headers.

Usage

extract_header_info(
  header_lines,
  label,
  filename,
  required = FALSE,
  multiline = FALSE
)

Arguments

header_lines

Character vector holding raw header lines

label

Label to search for - character

filename

Filename (for error reporting purposes)

required

Is this label required? (logical)

multiline

Can this label hold multi-line information? (logical)

Details

CSV files can have headers, commented lines of the form "# Title: xxxx", "# Source: xxxx", etc. Extract this information if present. Note that empty headers are not allowed. This function is called by parse_csv_header.

Value

Extracted label information, as a character vector


JGCRI/gcamdata documentation built on March 21, 2023, 2:19 a.m.