have a look for the programs
dos2unix
unix2dos
they are availbale on Solaris, hopefully(for you case) someone has made a
Linux one!
----- Original Message -----
From: Kervin <[EMAIL PROTECTED]>
To: Dan Browning <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, October 17, 1999 11:48 AM
Subject: Re: Convert unix text files to DOS text files (i.e., convert \n to
\n\r)
> I don't know of a tool that does that.
>
> May be able to do it with a simple shell script using sed. The following
> was taken from "useful sed one-liners" found at
> http://www.cornerstonemag.com/sed/sed1line.txt
>
> TEXT CONVERSION AND SUBSTITUTION:
>
> # IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
> sed 's/.$//' # assumes that all lines end with CR/LF
> sed 's/^M$//' # in bash/tcsh, press Ctrl-V then Ctrl-M
> sed 's/\x0D$//' # sed v1.5 only
>
> # IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
> sed "s/$/`echo -e \\\r`/" # command line under ksh
> sed 's/$'"/`echo \\\r`/" # command line under bash
> sed "s/$/`echo \\\r`/" # command line under zsh
>
> # IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format
> sed "s/$//" # method 1
> sed -n p # method 2
>
> # IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
> # Cannot be done with DOS versions of sed. Use "tr" instead.
> tr -d \r <infile >outfile # GNU tr version 1.22 or higher
>
>
>
> Dan Browning wrote:
> >
> > What utils are available (preferable ones that use STDIN, STDOUT, and
> > STDERR) to convert unix text files to DOS (win,etc.) text files and
back?
> > Written in C, and can process gigabytes of small text files fast?
> >
> > Dan Browning
> > Network Administrator
> > Cyclone Computer Systems