Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leading whitespace causes header row duplication #747

Closed
tdsmith opened this issue Nov 20, 2017 · 5 comments
Closed

Leading whitespace causes header row duplication #747

tdsmith opened this issue Nov 20, 2017 · 5 comments
Labels

Comments

@tdsmith
Copy link

@tdsmith tdsmith commented Nov 20, 2017

Adding whitespace at the beginning of a file (or between the end of a list of comments and a header row) causes the header row to be duplicated in the data.

Compare:
No leading whitespace; gives expected result

> read_csv("foo,bar\n1,2")
# A tibble: 1 x 2
    foo   bar
  <int> <int>
1     1     2

With leading whitespace; duplicates header row (and changes column types)

> read_csv("\nfoo,bar\n1,2")
# A tibble: 2 x 2
    foo   bar
  <chr> <chr>
1   foo   bar
2     1     2

readr is version 1.1.1. Thanks!

@jimhester jimhester added the bug label Dec 7, 2017
@jimhester
Copy link
Member

@jimhester jimhester commented Dec 7, 2017

I can reproduce this, looks like a bug.

Loading

@J535D165
Copy link

@J535D165 J535D165 commented Dec 7, 2017

Duplicate of #680

Loading

@jimhester
Copy link
Member

@jimhester jimhester commented Dec 11, 2017

Closed by 6517708

Loading

@jimhester jimhester closed this Dec 11, 2017
@tdsmith
Copy link
Author

@tdsmith tdsmith commented Dec 11, 2017

Awesome; thanks!

Loading

@lock
Copy link

@lock lock bot commented Sep 25, 2018

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/

Loading

@lock lock bot locked and limited conversation to collaborators Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants