Skip to content

"Unable to find 5 lines with expected number of columns" warning when freading 16 lines #1124

Closed

Description

@richierocks

When calling fread on a file with exactly 16 lines, I get the warning "Unable to find 5 lines with expected number of columns (+ last)".

To reproduce:

library(data.table)
n <- 16
d <- data.table(
  x = 1:n,
  y = letters[1:n]
)

lines <- c(
  paste(colnames(d), collapse = ","), 
  paste(d$x, d$y, sep = ",")
)
(lines <- paste(lines, collapse = "\n"))
## [1] "x,y\n1,a\n2,b\n3,c\n4,d\n5,e\n6,f\n7,g\n8,h\n9,i\n10,j\n11,k\n12,l\n13,m\n14,n\n15,o\n16,p"
fread(lines)

If you change n to 15 or 17, the warning does not occur.

Activity

  1. skatastic commented on Oct 7, 2015

    @skatastic
  2. sanmai-NL commented on Dec 18, 2015

    @sanmai-NL

    I also suffered this bug today.

  3. added this to the v1.9.8 milestone on Dec 21, 2015
  4. added a commit that references this issue on Dec 21, 2015
  5. added a commit that references this issue on Mar 6, 2016
  6. pseemakurthi commented on May 23, 2016

    @pseemakurthi

    I encountered the same bug using 1.9.7 freadversion

  7. jangorecki commented on May 23, 2016

    @jangorecki
    Member

    @pseemakurthi did you try latest development version? optionally provide output of read.dcf(system.file("DESCRIPTION", package="data.table"), c("Packaged","Built"))

  8. arunsrinivasan commented on May 26, 2016

    @arunsrinivasan
    Member

    This has been fixed in the devel version. Please try it and post a new issue if you still get the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions