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

Re: How convert PC text to UNIX ascii



Andre (sorry, no accented characters from me :)

when the nice unix people made text files years ago, they decidedthe
end-of-line character should be "\n" -- aka ^J. When the not-so-nice DOS
people made the same decision, they used two characters ^J and ^M. I would
imagine you need to strip out the ^M from your files before they work. (As a
side note, when the not-so-nice mac people made the same decision, rather
than take he pc format, which was popular at the time, or the unix format,
which was probably more popular at the time, they used ^M alone.)

PLain ASCII format just means -- no high-bit characters eg, all chars have
values of 127 or lower. Since ^M fits below 127, it is an ascii format. (But
then again, ascii is just the meanings of the 8 bits -- so I imagine all 256
chars are used in 'plain ascii' files -- binary not meaning anything much
different.)

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? :)

If someone has a better reference to the history of crlf problems 
please feel free to forward it to at least me. :)

On Fri, Aug 27, 1999 at 11:58:16PM -0700, André Bell wrote:
> I have several perl scripts saved to my pc I need to convert to linux-able
> ascii so I can transfer them to my local linux system via disks or tape.  I
> now get the following error message when I copy from my pc to diskette to
> linux:
> 
> > illegal character \015 (carriage return) at admin.cgi line 2
> > (Maybe you didn't strip carriage returns after a network transfer?)
> 
> I know it's because the file is in pc binary instead of true ascii (despite
> being saved as a text file). My question is this, is there any way I can
> convert the file to true ascii while it's still on my pc then copy it to
> floppy then copy it to linux, without the need to ftp the file between one
> system and the other?
> 
> Thanks!
> 
> Andre
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null

-- 
Seth Arnold | http://www.willamette.edu/~sarnold/
Hate spam? See http://maps.vix.com/rbl/ for help
Hi! I'm a .signature virus! Copy me into
your ~/.signature to help me spread!


Reply to: