Convert text line endings using sed executable
#30
andry81
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Source code
A simple variable of unix2dos conversion without fix a trailing line ending:
sed.exe -n -b -e "H;1h;$!d;x" -e "s/\r\([^\n]\)/\r\n\1/mg" -e "s/\r\([^\n]\)/\r\n\1/mg" -e "s/\([^\r]\)\n/\1\r\n/mg" -e "s/\([^\r]\)\n/\1\r\n/mg" -e "s/^$/\r/mg" -e "p" FILEIt will replace
CR CRLF LF CRintoCRLF CRLF CRLF CRLF.Beta Was this translation helpful? Give feedback.
All reactions