lf-to-crlf also inserts crlf at end-of-file in addition to converting
One hundred command line tools in a small and portable binary.
Brought to you by:
stahlworks
I assume this is a bug, just wanted to let you know. Not critical for me to fix.
To reproduce:
Create a new file (test.txt) with two lines, having a single CRLF at the end of the first line only.
Run SFK:
sfk lf-to-crlf test.txt
Result:
The file will now have a CRLF at the end of the second line as well as the first.
Expected result:
No change.
Again, not critical, thanks for the tool!
I cannot reproduce. I think this issue is fixed since a long time. Please make sure that you use the latest sfk 1.7.5 or the 1.7.6 pre-release from http://stahlworks.com/dev/pre/
You probably mean: having a single LF at the end of the first line.
Test:
check sfk version by
sfk ver.
create a file tmp1.txt with two lines in unix format, the second line having no line ending
first line
second line
sfk hexdumple tmp1.txt tells:
66697273 74206C69 6E650A73 65636F6E 64206C69 6E65
so there is only one "0A" unix line ending.
sfk lf-to-crlf tmp1.txt
sfk hexdumple tmp1.txt tells:
66697273 74206C69 6E650D0A 7365636F 6E64206C 696E65
and there is only one "0D0A" CRLF line ending.
Sorry, my bad.
I used Chocolatey to install, and it seems that version is very much out of date.
(https://chocolatey.org/packages/SwissFileKnife currently at SFK v1.6.9)