[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How convert PC text to UNIX ascii



An easy way to find whether a file is in Debian is to do a zgrep on the
Contents-i386.gz file (assuming Intel platform). You may need to pipe
the output into whatever pager you like. The output will tell you what
package the file is in (e.g. dos2unix is in sysutils). If you're getting
Debian over the network, the file is not too big, 1.3M or so.

Ernest Johanson
Web Systems Administrator
Fuller Theological Seminary


On Sat, 28 Aug 1999, [iso-8859-1] André Bell wrote:

> Date: Sat, 28 Aug 1999 01:31:17 -0700
> From: "[iso-8859-1] André Bell" <debian2@one-click.com>
> To: Seth R Arnold <sarnold@willamette.edu>, debian-user@lists.debian.org
> Subject: Re: How convert PC text to UNIX ascii
> 
> >The way to get rid of those ^M characters is to either transfer the files
> >using ascii mode in ftp, or use the dtox program or dos2unix program or
> >:%s/^V^M//g in vi, or a sed script or write a program or .. half a million
> >ways to do the same thing (would recode do it? :)
> >
> 
> Thanks Seth, that's exactly the info I was looking for. My linux pc is not
> yet networked to my pc so I'm forced to transfer small via floppy for now.
> I will do a search for dtox and dos2unix.  Looks like neither are a part of
> debian so I searched the net for them.
> 
> Here's one solution from http://ume.med.ucalgary.ca/usenet/Linux/0053.html:
> 
> -------------------- save as dos2unix --------------------------------- 
> #!/bin/sh 
> sed 's/^M//' $1 
> ----------------------------------------------------------------------- 
> -------------------- save as unix2dos --------------------------------- 
> #!/bin/sh 
> sed 's/$/^M/' $1 
> ----------------------------------------------------------------------- 
> 
> 
> Note that the `^M' has to be produced by pressing `Ctrl-V Ctrl-M' in vi, or 
> `Ctrl-QCtrl-M' in emacs. Then you can do, e.g., `dos2unix < unixfile > 
> dosfile' and `unix2dos < unixfile > dosfile'. 
>        ----- end ------
> 
> Those look like perl scripts. If so it's just that I'm unfamiliar with the
> SED command that is throwing me off. I'll try each as a perl script anyways
> just to be sure.
> 
> Andre
> p.s. Here is aother solution:
> cat <filename> | sed 's/^M//' <-- I tried this one, it didn't convert the
> file, it ran the file (all of the print commands printed to screen.
> Afterwards I typed perl <filename> and same issue exists.  I even tried
> this command and piped it with ">" to create anew file still the same error
> message :( 
> 


Reply to: