Skip to content

fread fail to read single row single column datetime field #2609

@jangorecki

Description

@jangorecki

single row, single column datetime is not read, after adding extra column it works fine.

data.table::fread("c1\n2018-01-31 03:16:57")
#Empty data.table (0 rows) of 2 cols: V1,c1
#Warning message:
#In data.table::fread("c1\n2018-01-31 03:16:57") :
#  Detected 1 column names but the data has 2 columns (i.e. an invalid file format). Added 1 extra default column name for the first column which is guessed to be row names or an index. Use setnames() afterwards if this guess is not correct, or fix the file write command that created the file to create a valid file.
data.table::fread("c1,c2\n2018-01-31 03:16:57,b")
#                    c1 c2
#1: 2018-01-31 03:16:57  

@MichaelChirico

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions