Skip to content

[R-Forge #4992] Using sep = "." in fread yields "unexpected character" error #502

@arunsrinivasan

Description

@arunsrinivasan

Submitted by: Ananda Mahto; Assigned to: Nobody; R-Forge link

When trying to read data separated by a ., fread yields an error with consecutive numeric values, for example:

library(data.table)
packageVersion("data.table")
# [1]1.8.10

y <- paste("192.168.1.", 1:10, sep = "")
notworking <- tempfile()
writeLines(y, notworking)
fread(notworking, sep = ".", header = FALSE)

The following examples work:

z1 <- paste("192. 168. 1. ", 1:10, sep = "")
working1 <- tempfile()
writeLines(z1, working1)
fread(working1, sep = ".", header = FALSE)

z2 <- paste("Hz.BB.GHG.", 1:10, sep = "")
working2 <- tempfile()
writeLines(z2, working2)
fread(working2, sep = ".", header = FALSE)

See this SO post.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions