Dos2Unix and Unix2Dos : Text File Format Converters

The way operating systems have evolved in the last 50 years, they all adopted to different standards of encoding and saving the data. Today we know that on the UNIX based systems, a text file uses the special line-feed character (ASCII value 10) to indicate end of a line (EOL). On the other hand for Apple Macintosh systems, a text file has to use the special carriage-return character (ASCII value 13) to indicate the end of line. Microsoft Windows takes the combined approach and uses the carriage-return followed by the line-feed (ASCII 13 and then ASCII 10) to show the end of the line in a text file.

When a text editor encounters these EOL characters, the text editor knows that where the line has ended and a new line has begun. Depending on which operating system a text file was edited on, the text file might contain a specific EOL character. For opening and viewing text files properly, we must convert their EOL characters to the current operating systems.

EOL Converter

There are some command line tools called Dos2Unix, Unix2Dos for conversion of the EOL between UNIX and DOS. Similarly, there are some command line tools Mac2Unix and Unix2Mac for conversion of EOL between UNIX and Macinstosh.

Using these command line tools is very easy as they all take only one parameter – the text file to be converted. For example, if you want to convert EOL from UNIX to DOS, then give command Unix2Dos Report.txt where Report.txt is the file you want to convert. Rest of the tools work in a similar manner.

EOL Converter

If you are a Windows user then you can easily check the EOL character used in a text file by opening it in Notepad++. You can see the EOL in the status bar of the Notepad++ window. Notepad++ also allows you to convert the EOL easily through its menubar.

You can download Unix2Dos, Dos2Unix, Mac2Unix, Unix2Mac tools from