Guess Metadata about a Text File

guess_file_metadata(file, n_first_rows = 1000, ...)

Arguments

file

path to text file

n_first_rows

number of first rows of file from which to guess the meta information.

...

further arguments passed to readLinesWithEncoding, such as fileEncoding

Value

data frame with columns

  • paths: does the file seem to contain path information, i.e. were slashes or backslashes found?

  • forbidden: does the file contain characters that are forbidden in file paths?

  • header: does the file seem to contain a header row?

  • windows: are the paths given in "windows"-style, i.e. are the path segments separated by backslash?

  • sep: column separator guessed

  • ncol: number of columns guessed

and attributes

  • file: a copy of the file path given in file

  • first_rows: first n_first_rows rows of file

  • columns (optional): column headers if the file is assumed to contain a header row