Convert CRLF's to line feeds on Linux
How can I convert a DOS text file to Unix text file, so I can use my Linux parser properly?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
dos2unix is a tool for converting line endings.
Most Unix installations include the 'tr' command ('tr' is short for 'translate') - you could use that to convert your input file with DOS text to output Unix text format:
tr -d '\r' < dos.txt > unix.txt
On Debian-derived (Ubuntu, etc) systems, you want the
tofrodos package, which provides the commands
fromdos is the one you are looking for.)
On RedHat-derived systems (RHEL, Centos, Fedora, etc), you want the
dos2unix package, which provides the commands
mac2unix. To convert in the other direction, you'll want the
unix2dos package, which provides the
If you mean "how do I convert a plain-text file in DOS format to a plain-text file in UNIX format", try the dos2unix command.
Here's an explanation of how to use antiword to extract the text.