different quoting behavior, depending on whitespace #668
Labels
Comments
I'm running up against this too. It's especially damaging if you're using the quotes to protect embedded commas. Also: something is off with the printing of the problems? library(readr)
read.csv(text = 'x,y\n1,\"hi,there\"\n3,4')
#> x y
#> 1 1 hi,there
#> 2 3 4
read_csv('x,y\n1,\"hi,there\"\n3,4')
#> # A tibble: 2 x 2
#> x y
#> <int> <chr>
#> 1 1 hi,there
#> 2 3 4
read.csv(text = 'x,y\n1, \"hi,there\"\n3,4')
#> x y
#> 1 1 hi,there
#> 2 3 4
read_csv('x,y\n1, \"hi,there\"\n3,4')
#> Warning in rbind(names(probs), probs_f): number of columns of result is not
#> a multiple of vector length (arg 2)
#> Warning: 1 parsing failure.
#> row # A tibble: 1 x 5 col row col expected actual file expected <int> <chr> <chr> <chr> <chr> actual 1 1 <NA> 2 columns 3 columns literal data file # A tibble: 1 x 5
#> # A tibble: 2 x 2
#> x y
#> <int> <chr>
#> 1 1 "\"hi"
#> 2 3 4 |
@jimhester Thanks! |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Sometimes I will write out a small csv by hand - by habit I will put a space after a comma:
When I
read_csv()
this, it parses inconsistently.However, if I take out the whitespace, it parses as I expect:
Reprex:
Does this rise to the level of bug? Also, may be similar to #238.
The text was updated successfully, but these errors were encountered: