HardwareHacks 2000

You are here: Skip Navigation LinksHardwareHacks 2000 > Software > LineConv


LineConv

Translate UNIX/LF to MS-DOS/CRLF and vice-versa

If you program on a Windows box you'll probably find these tools useful. LineConv is comprised of two tools. unix2dos converts UNIX-like LF line endings to DOS-like CRLF line endings. The result is that you'll be able to access the files from more ordinary text editors like Notepad without having to resort to more power-hungry editors like Visual Studio. dos2unix does the inverse. Both were inspired by their respective Python equivalents.

The tools are written using the .NET Framework 2.0. Vista has this preinstalled. If you're on an earlier operating system and don't already have it installed, you can grab the installer from the Microsoft Download Center.


Syntax

To convert an LF text file to CRLF: unix2dos [filename]
To convert a CRLF text file to LF: dos2unix [filename]

Both tools will automatically overwrite the input file with the corresponding line ending format.


Download Links


Future Releases

I'm thinking of implementing a recursive feature in future releases, so that one can change the line endings of all applicable files in a single directory or entire directory tree.