Skip to content

Implement comment.char argument in fread #856

Description

@arunsrinivasan

Similar to read.table.

Activity

  1. mattdowle commented on Oct 3, 2014

    @mattdowle
    Member

    Need to ignore whole lines (starting with comment) as well as trailing comments after valid lines.

  2. mattdowle commented on Sep 23, 2015

    @mattdowle
    Member
  3. added this to the v1.9.8 milestone on Dec 17, 2015
  4. modified the milestones: , v1.9.8 on Mar 7, 2016
  5. eddelbuettel commented on Oct 19, 2017

    @eddelbuettel
    Contributor

    Bump. Needing this right now.

  6. RLathamBAH commented on Jan 19, 2018

    @RLathamBAH
  7. DavidArenburg commented on Feb 14, 2018

    @DavidArenburg
    Member

    Actually fread seem to assume it already has this implemented as it is mentioning comment.char in its warnings. This is a warning I've recently saw (using the dev 1.10.5 version)

    Warning in fread(file_x, skip = startind - 1L, header = TRUE, fill = TRUE) :
    Stopped early on line 2. Expected 168 fields but found 235. Consider fill=TRUE and comment.char=.

    Also, not sure why isn't this an error? It make it harder to catch it with tryCatch

  8. eddelbuettel commented on Feb 14, 2018

    @eddelbuettel
    Contributor

    Interesting. Can you chase the comment and find an author and commit per git blame?
    I am mostly using the CRAN version so I work around the issue (when I have to, which is not that often).

  9. DavidArenburg commented on Feb 14, 2018

    @DavidArenburg
    Member
  10. eddelbuettel commented on Feb 15, 2018

    @eddelbuettel
    Contributor

    Thanks. Which one can click on for git blame so yield ...

    Better skip= and nrow= (#2623)

    by Matt just one day ago (!!)

  11. map2085 commented on Apr 3, 2018

    @map2085
  12. removed this from the milestone on May 10, 2018
  13. 12 remaining items

  14. jangorecki commented on May 10, 2019

    @jangorecki
    Member

    @ArthurPERE it is best to use a documentation as reference and defined behaviour. There you can also find there is no such a thing like comment.char parameter. You can find fread manual at https://rdatatable.gitlab.io/data.table/library/data.table/html/fread.html

    AFAIR status of this FR or works on it are well reflected in comments. Be sure to upvote this FR so it will likely speed up its implementation, or at least prioritise. You are also welcome to submit a patch introducing such feature.

  15. davidlvb commented on Aug 7, 2019

    @davidlvb
  16. DanielMedic commented on Jan 28, 2020

    @DanielMedic
  17. darcyj commented on Mar 18, 2020

    @darcyj
  18. doorisajar commented on Jun 4, 2020

    @doorisajar
  19. added
    top requestOne of our most-requested issues
    and removed on Jun 7, 2020
  20. asgr commented on Aug 4, 2020

    @asgr
  21. mjsteinbaugh commented on Jan 13, 2021

    @mjsteinbaugh

    Following up on this, I'm open to helping develop and/or test this functionality in a future update

  22. jangorecki commented on Jan 13, 2021

    @jangorecki
    Member

    @mjsteinbaugh you are very welcome, please submit PR

  23. dvg-p4 commented on Nov 14, 2024

    @dvg-p4
    Contributor

    There is still that error message that references comment.char:

    Warning in fread("vep_output") :
      Stopped early on line 4. Expected 6 fields but found 5. Consider fill=TRUE and comment.char=. First discarded non-empty line: <<## Using cache in /home/dgealow/.vep/homo_sapiens/113_GRCh38>>
    

    This is incredibly confusing since comment.char is not a parameter to fread. If there are no plans to actually implement it any time soon (I notice this ticket has been open for 10 years) I'd suggest removing the reference from that error message.

  24. MichaelChirico commented on Nov 14, 2024

    @MichaelChirico
    Member

    We have a pending PR: #4486. It requires some love to get it over the line :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions