| End-of-Line Converter |
Different computers use different symbols to mark the end of a line. Therefore, some text files end with carraige returns (CR), others with line feeds (LF), and others with both. Macintosh computers use CR (0D hex), UNIX computers use LF (0A hex) and DOS/Windows computers use CR/LF pairs (0D0A). Adding to this confusion, some e-mail and web servers attempt creating a universal format by converting each end-of-line to CR/CR/LF (0D0D0A). Fortunately, most programs can automatically recognize and read any type of format. For programs that can not, I have created EOLNconv: a simple drag and drop program for Windows that can convert between formats. Simply select the format you want the output to be in, and then drop your files on the converter. For example, if you drop the file filename.txt onto the converter, the original file will be renamed filename.old and a new file with the name filename.txt will be created with the desired line endings. This software should only be used for ASCII text data: binary data will be corrupted. For this reason, it only converts files with the extensions .txt, .m, .mat. If you want to convert files with a different extension, you can always use my extension converter first.
![]() |
One useful feature for this tool is reconstructing Matlab .m/.mat files that have been corrupted by line endings being changed to CR/CR/LF by a web server. While Matlab can read Macintosh, DOS and Unix format files fine, it quite sensibly interprets files with CR/CR/LF as having double spacing. Therefore, a file that was supposed to look like this:
Will not work, and will appear like this
My software allows you to convert hundreds of corrupted Matlab .m and .mat files in a single action.
![]() |