Skip to content

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

Closed

Description

@arunsrinivasan

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)

Activity

  1. added this to the v1.9.8 milestone on Oct 29, 2015
  2. added a commit that references this issue on Oct 29, 2015
  3. arunsrinivasan commented on Oct 29, 2015

    @arunsrinivasan
    MemberAuthor

    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions