Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfread skip in v1.11.0+ returns error when it used to work in v1.10.x #3006
Comments
|
I am having the same issue as you described. My file is formatted by scientific equipment and fread without skip will only give me a portion of the data I actually want, so even the workaround doesn't work. I want to skip the first 29 lines with "fread('Raw Data/FRRF/20170601-212720.csv', sep = ',', skip = 29, nrows = 21)": Error in fread("Raw Data/FRRF/20170601-212720.csv", skip = 10, sep = ","): skip=10 but the input only has 1 line
|
|
@tbrycekelly can you run |
|
Sure, @MichaelChirico. |
|
And I should include that without the skip parameter this is what fread finds: V1 V2 |
|
I have exactly the same problem: a colleague exported a .csv from Windows excel, and when I tried to read in with fread in combination with the skip option I got: Error in fread(file = "data.csv", blank.lines.skip = T, : without skip it is no problem. I am using version 1.11.4 Is this maybe a bug? |
|
Any updates on this front?
…On Sat, Nov 10, 2018 at 2:33 AM solmonta ***@***.***> wrote:
I have exactly the same problem: a colleague exported a .csv from Windows
excel, and when I tried to read in with fread in combination with the skip
option I got:
Error in fread(file = "data.csv", blank.lines.skip = T, :
skip=10 but the input only has 1 line
without skip it is no problem.
I am using version 1.11.4
I never had this message before when I was using older versions of
data.table on the same data set.
Is this maybe a bug?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3006 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHX0P3bzSpCeAQusSRyHBBYmMTrUWBAqks5utYQTgaJpZM4WFneB>
.
|
I have output from a vehicle monitoring system that is exported in .csv format. It has a set of data headers (2 columns for 25 rows), a blank row, followed by time/speed/distance data in 6 columns.
When using data.table 1.10 the following command worked:
fread("otmr1a", skip=26L)In version 1.11.4 the same command gives:
If the skip is removed, fread works perfectly:
Because fread works on the file, the easy work-round is to select rows after import:
The line end is "^M" from a Windows package:
Name Value ^MConfiguration 345 ^MCreation 17/04/2018 08:02 ^MCustomer Id MTR ^MDistance Unit Centimeter (cm) ^MDistance Unit (Display) Mile (mi) ^MDistance Unit (User) Mile (mi) ^MEnd Distance "4,743.8927 mi" ^MEnd Time 03:12.0 ^MFile Z:\Documents\OTMR\_2018_03_14-17_03_00003.tel\INT_TDATA ^MIssue Number I19 ^MMemory Type INT_TDATA ^MName TELOC Dataset ^MRecords "6,512,724" ^MSerial Number 17028710 ^MSoftware Version 2402.04.24.01 ^MStart Distance 61.5482 mi ^MStart Time 57:55.2 ^MTime Zone Coordinated Universal Time (UTC) ^MTime Zone (User) Coordinated Universal Time (UTC) ^MTotal distance counter "4,743.8927 mi" ^MVehicle Id Unknown ^MVehicle Type Class345 ^MWheel Diameter 31.496 in ^M ^MRecord Id Date Time Distance (mi) SYS_SPEED (km/hCIU_TraBrkEffRef (%)^M4896722 26/02/2018 05:50:08 3862.23 0 0^M4896723 26/02/2018 05:50:09 3862.230^M4896724 26/02/2018 05:50:09 3862.23 0 0^M4896725 26/02/2018 05:50:09 3862.23 0 0^M4896726 26/02/2018 05:50:10 3862.23 0 0^M4896727 26/02/2018 05:50:11 3862.23 0 0^MIf I use fread to load the package, and then save using fwrite, then the problem disappears on reloading. This means that if I use R to create a small version of the dataset to provide a reproducible example, the problem disappears.
I wasn't sure if it was linked in any way to:
#2857
#2943
Happy to provide original data sets if that helps but I can't put it on public sites beyond the sample provided above.
#Output of sessionInfo()