Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 1997 05:33:24 -0600 (CST)
From:      "Daniel M. Eischen" <deischen@iworks.InterWorks.org>
To:        jcs@dhi.dk, questions@freebsd.org
Subject:   Re: dos2ux
Message-ID:  <199703121133.FAA01506@iworks.InterWorks.org>

next in thread | raw e-mail | index | archive | help

> could anybody tell how to get rid of all the strange characters
> which appear when I get a file from DOS. I work also in 
> a HP machine and there we have a command called dos2ux,
> but we do not have it in FreeBSD.

Go to the FreeBSD web page and search questions for "MS-DOS text
files in UNIX".

Here's one of the postings made by Gary Chrysler <tcg@ime.net>:

-=-=-=-=-=-=-=-=- CUT unix2dos.pl
#!/usr/bin/perl -pi
#
# Convert Unix text file to DOS file format.  Conversion is done in-place.
#
# Usage: unix2dos unixfile ...
print STDERR "Converting \"$ARGV\" ...\n" if (eof || ($. == 0));
s/$/\015/;                   # tack on ^M
s/\n/\n\032/ if (eof);       # DOS ^Z at end of file.
-=-=-=-=-=-=-=-=- CUT unix2dos.pl

-=-=-=-=-=-=-=-=- CUT dos2unix.pl
#!/usr/bin/perl -pi
#
# Convert DOS text file to Unix file format.  Conversion is done in-place.
#
# Usage: dos2unix dosfile ...
print STDERR "Converting \"$ARGV\" ...\n" if (eof || ($. == 0));
s/\015$//;                   # strip ^M from end of line.
s/\032$//;                   # strip ^Z if we see it (which'll be at EOF).
-=-=-=-=-=-=-=-=- CUT dos2unix.pl

here is a couple of perl scripts that I use!
I forgot who wrote em, I sure do thank em!

-Enjoy
Gary
~~~~~~~~~~~~~~~
Improve America's Knowledge... Share yours
The Borg... Where minds meet
(207) 929-3848


Dan Eischen
deischen@iworks.InterWorks.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703121133.FAA01506>