How to Convert DOS and UNIX text files

How do I convert between Unix and DOS text files?


The UNIX and DOS operating systems (which includes Microsoft Windows) differ in the format in which they store text files. DOS places both a line feed and a carriage return character at the end of each line of a text file, but Unix uses only a line feed character. Some DOS applications need to see carriage return characters at the ends of lines, and may treat Unix-format files as giant single lines. Some Unix applications won't recognize the carriage returns added by DOS, and will display Ctrl-m characters at the end of each line. This appears on the screen as ^M.

There are many ways to solve this problem. In this document we provide instructions on how to use FTP, screen capture, unix2dos and dos2unix, tr, awk, Perl, and Emacs, to do the conversion. Before you use these utilities, the files you are converting must first be on a Unix computer.

page created by admin last modified 2004-08-12 20:57