Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_lines truncates at \001 #1506

Open
ronhylton opened this issue Aug 13, 2023 · 0 comments
Open

read_lines truncates at \001 #1506

ronhylton opened this issue Aug 13, 2023 · 0 comments

Comments

@ronhylton
Copy link

read_lines appears to truncate lines with \001 delimiters

library(readr)

R.version.string  # on Windows 10
#> [1] "R version 4.3.1 (2023-06-16 ucrt)"

packageVersion("readr")
#> [1] '2.1.4'

lines <- c("one\001two\001three","four\001five\001six") # delimited with \001
file <- tempfile("lines.txt")
write_lines(lines, file)

expected <- readLines(file)
expected
#> [1] "one\001two\001three" "four\001five\001six"

identical(lines, expected)
#> [1] TRUE

unexpected <- read_lines(file) # lines appear to be truncated at first \001
unexpected
#> [1] "one"  "four"

identical(lines, unexpected)
#> [1] FALSE

rm(file)

Created on 2023-08-13 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant