Repository navigation
[fread] broken functionality in 1.9.6 #1267
Description
Activity
- changed the title
[-]broken fread functionality in dev version[/-][+]broken fread functionality in dev version 1.9.5[/+]on Aug 14, 2015 - changed the title
[-]broken fread functionality in dev version 1.9.5[/-][+][fread] broken functionality in dev version 1.9.5[/+]on Aug 14, 2015 Minimum reproducible code is now added.
This bug has now been released in v1.9.6.
- changed the title
[-][fread] broken functionality in dev version 1.9.5[/-][+][fread] broken functionality in 1.9.6[/+]on Sep 20, 2015 @ziyadsaeed
you can self-close resolved issue, OKit isn't resolved. I'm mentioning that this bug was not fixed in the dev version and now the release version 1.9.6 has this bug.
The default behaviour is right as it is. I'd expect
skip=0explicitly to work as you intend however.what is the workaround to ask fread to just read the first line.
When 1.9.6 was released it should be mentioned somewhere that it breaks existing functionality from 1.9.4 and a workaround should have been mentioned.in 1.9.6 (and 1.9.7 to this point of time)
nrowsno longer forcesfreadto just read those rows.
this makes me frustrated on small files with only the last line having less columns.fread("1,2,3\n1,2", nrows=1)wont work and there seems to be no work-around...
i'd like to achieve reading the entire file except for the unbalanced last line.and this only happens in small files:
for ( i in 100:1) { lines <- paste0(paste(rep("1,2,3", i), collapse='\n'), "\n1,2") fread(lines, nrows=i) }
the above code stopped at i =4, which means the somewhat "undocumented" type checking behavior forces a parsing of at least 5 lines, regardless of the actual number of lines in the given file.
the impact of such feature is that whenever we are
freading a bunch of files with a special treatment of last line (as we already know that the last line and only the last line may be unbalanced in column numbers but we still want to read it separately afterfreading the entire file except the last line), and there are files smaller than 6 lines with the last line unbalanced, we need a workaround. (i.e., to not usefreadin these circumstances)it will be appreciated that if we can optionally disable such type-checking behavior, or the argument
nrowsis actually not doing what it looks like to do: read only the firstnrowslines. :)- modified the milestones: This milestone has been deleted, This milestone has been deleted
on Jan 30, 2018 - added a commit that references this issue
on Jan 30, 2018
fread from v1.9.4 gives correct results but fread from dev 1.9.5 doesn't.
For eg
create a test.csv file
Notice there are different number of columns
fread from 1.9.4
This is what I want
But in fread from v1.9.5
Not the expected result.