Skip to content

Tolerate blank lines ... at least at the end of input? #321

Description

@jennybc
library(readr)
input <- "x,y\n1,2\n\n"
read.csv(text = input)
#>   x y
#> 1 1 2
read_csv(input)
#> Warning: 1 parsing failure.
#> row col  expected    actual
#>   2  -- 2 columns 1 columns
#> Source: local data frame [2 x 2]
#> 
#>       x     y
#>   (int) (int)
#> 1     1     2
#> 2    NA    NA
read_csv(trimws(input))
#> Source: local data frame [1 x 2]
#> 
#>       x     y
#>   (int) (int)
#> 1     1     2

It seems reasonable to tolerate and ignore blank lines ... at least at the end of the input.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions