I am trying to use readr::read_fwf
to read-in a .txt file. I know all of the column widths but I receive this parsing error which I do not know how to resolve:
fwf_widths <- c(12, 2, 6, ...)
fwf_names <- c("V1", "V2", "V3", ...)
col_types <- c("ccc...")
df <- read_fwf(file = file, fwf_widths(fwf_widths, fwf_names),
col_types = col_types)
Warning: 1 parsing failure.
row col expected actual file
372722 description embedded null /path/to/my/file.txt
I've tried adding trim_ws = T
which does not get rid of the error. I looked at the actual contents of df[372722, ]
and it looks like description
contains the correct contents. Can someone please help me interpret what embedded null
means and how I can potentially deal with this issue?