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

[R-Forge #5422] fread: Support for files where header rows are separated from data #530

Closed
arunsrinivasan opened this issue Jun 8, 2014 · 1 comment
Assignees
Milestone

Comments

@arunsrinivasan
Copy link
Member

Submitted by: Dirk Jonker; Assigned to: Nobody; R-Forge link

Example file:
http://www.knmi.nl/klimatologie/daggegevens/datafiles3/vorigemaand.txt

Column names are on row 48, data starts at row 50. Row 49 is empty. It is not possible to use fread to read only row 48.

Two possible solutions I could think of:

  • Add a parameter, e.g. headerrow=48
  • Skip empty row(s) between header and data, if header contains the same number of fields (more dangerous, but possibly more user friendly)
@arunsrinivasan arunsrinivasan added this to the v1.9.8 milestone Oct 29, 2015
@arunsrinivasan arunsrinivasan self-assigned this Oct 29, 2015
arunsrinivasan added a commit that referenced this issue Oct 29, 2015
@arunsrinivasan
Copy link
Member Author

With the new blank.lines.skip we can now do:

x = 'a,b,c\n1,2,3\n4,5,6\nx,y\n\n1,2\n3,4"
fread(x, skip=2L, blank.lines.skip=TRUE)
#    x y
# 1: 1 2
# 2: 3 4

arunsrinivasan added a commit that referenced this issue Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant