Learn R Programming

icesTAF (version 1.3-2)

dos2unix: Convert Line Endings

Description

Convert line endings in a text file between Dos (CRLF) and Unix (LF) format.

Usage

dos2unix(file)

unix2dos(file)

Arguments

file

a filename.

See Also

file is used to open a binary connection to the text file.

writeLines is used to apply CRLF or LF line endings.

icesTAF-package gives an overview of the package.

Examples

Run this code
# NOT RUN {
file <- "test.txt"
write("123", file)

dos2unix(file)
file.size(file)

unix2dos(file)
file.size(file)

file.remove(file)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab