-
Notifications
You must be signed in to change notification settings - Fork 286
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
Get write_lines() to write Windows new lines (CRLF) #665
Comments
I think just using |
Haha , forgot about base::* ! But base::writeLines() lack an EOL parameter so it will work while running on windows, not in linux. thanks
|
You can do the following to work the same regardless of platform. con <- file("xyz", mode = "wb")
writeLines(x, sep = "\r\n")
close(con) |
thanks! |
Hi, @jimhester if I may suggest something - I would not use "sep" name for argument about end of line mark. "sep" is traditionally used in base R functions to state what is a separator between columns. Maybe we could "eol" instead? |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
I'm aware of Issue #87 on read_csv(), and it's correct that write functions use the same terminator, but sometimes you need to write a file for another program, that only understands CRLF lines.
So I would like to be able to specify a CRLF line terminator as an option on write functions.
Meanwhile, the hackish way :
> write_lines(paste0(vData, "\r"), filePath))
Thanks for the great package.
The text was updated successfully, but these errors were encountered: