1

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?

I say Reinstate Monica
  • 25,487
  • 19
  • 95
  • 131
Rn2dy
  • 173
  • 2
  • 2
  • 7

7 Answers7

6

dos2unix is a tool for converting line endings.

Jeff Foster
  • 576
  • 4
  • 5
2

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

HTH!

PSM
  • 21
  • 1
1

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.

bstpierre
  • 1,282
  • 2
  • 20
  • 39
0

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.

CanSpice
  • 199
  • 4
0

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

Oren Hizkiya
  • 145
  • 6
0

Some systems have a dos2unix command.

Eric Johnson
  • 661
  • 1
  • 5
  • 15
0

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.

bmk
  • 2,145
  • 14
  • 12