implement comment.char argument for fread#7375
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7375 +/- ##
=======================================
Coverage 99.12% 99.12%
=======================================
Files 85 85
Lines 16589 16637 +48
=======================================
+ Hits 16444 16492 +48
Misses 145 145 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This reverts commit a0a9525.
| 5,6', nrows=2, comment.char='#'), data.table(a=c(1L,3L), b=c(2L,4L))) | ||
|
|
||
| # sep and comment char same | ||
| test(2341.16, fread('a#b |
There was a problem hiding this comment.
hm that's interesting. I don't know what I'd expect out of reading this file. E.g. data.table(a=1L, b=2L) also seems like a possible answer, and even data.table(a=c(1L, NA), b=c("2", "only comment")) could be justified too. Maybe let's just error if comment.char==sep?
|
Looks basically GTG. Main remaining thing I think is what to do about @eddelbuettel if you have any "real" files laying around you'd like to test on that would be most helpful :) |
|
LOL @MichaelChirico -- while I wrote eight years ago
I am sorry to say that I have not been sitting here with baited breath and no, I do not have that file around. I do not even remember what the comment character may have been. I am sure the PR will be fine. |
|
@Anirban166 it looks like some {pak} cacheing issue failing the atime GHA, any idea? https://github.com/Rdatatable/data.table/actions/runs/18658671941/job/53193860953 |
|
Generated via commit ba0c68a Download link for the artifact containing the test results: ↓ atime-results.zip
|
|
Haven't seen that one before, but I think its a flaky error having to do with network/resource contention as it worked now that you re-runned (the |
|
Thanks I'll try and notice if it recurs, indeed seems flaky. There were other failures related to missing branches, which clouded things. Seems restored to working now. |

Closes #856
Supersedes #4486
Needed this on machine without grep.
It should have no performance impact since we always check for
comment.charbefore entering costly checking branch.