Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
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?

share|improve this question

migrated from Apr 7 '11 at 16:09

This question came from our site for professional and enthusiast programmers.

marked as duplicate by grawity, Tom Wijsman, Sathya Apr 10 '11 at 17:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 6 down vote accepted

dos2unix is a tool for converting line endings (I'm guessing doc txt was a typo?).

share|improve this answer

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


share|improve this answer

On Debian-derived (Ubuntu, etc) systems, you want the tofrodos package, which provides the commands todos and fromdos. (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 dos2unix and mac2unix. To convert in the other direction, you'll want the unix2dos package, which provides the unix2dos command.

share|improve this answer

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.

share|improve this answer
My Ubuntu does not have it, how to get it? – baboonWorksFine Apr 7 '11 at 16:08

Here's an explanation of how to use antiword to extract the text.

share|improve this answer

Some systems have a dos2unix command.

share|improve this answer

Do you mean: You want to convert Windows text files into Linux text files? If yes: There's a utility dos2unix that will do the job for you.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .