[oclug] sed/tr question
Brenda J. Butler
bjb at istop.com
Fri Mar 18 21:06:41 EST 2005
On Fri, Mar 18, 2005 at 04:16:44AM -0500, Brenda J. Butler wrote:
> It's usually easier to use another tool for removing newlines from
> files, as Patrick and Stephen pointed out.
I forgot to mention: a couple of purpose-built
tools for this are dos2unix and unix2dos. You probably
have them available on your distro already (although I don't
on my Debian system, and I can't seem to find a package
with it). Oh well. There are lots of ways to do that.
Another way is to load the file into an editor (like emacs).
The editor will notice what kind of file it is and set the mode
automatically. Then give the command to switch modes, and
save the file back. In emacs, to convert a unix file
to dos (or vice-versa):
C-x <RET> f unix <RET>
C-x <RET> f dos <RET>
cheerio,
bjb
More information about the OCLUG
mailing list