Subject: Re: Help with Win -> NetBSD text files...
To: David Woyciesjes <DAW@yalepress3.unipress.yale.edu>
From: Matthias Buelow <mkb@mukappabeta.de>
List: netbsd-help
Date: 03/19/2001 19:48:16
David Woyciesjes <DAW@yalepress3.unipress.yale.edu> writes:

>Under Linux, you can use the command
># mount -o conv=auto -t msdos /dev/fd0a /mnt
>which will automatically convert the CR-LF to a newline at the ends of lines
>in a text file.

uh.. how does the filesystem decide which file on the floppy contains text,
or which parts of a file are text, and which isn't etc.?  Last time I looked,
DOS didn't have file types.

>How can this be done for NetBSD? Or should I use some other program on
>Windoze, (other than Notepad or Wordpad) for editing files destined for my
>NetBSD system?

There are several ports of Unix editors to MSDOS (and WinNT/3.11/95/98/etc)
and of course there are tools like Gnu recode (in pkgsrc) which convert
from many character sets to many character sets.  The latter is probably
your tool of choice -- if you have installed recode, you could for example
make a shell alias (or put it into a script file) "dos2unix" which
invokes "recode ibmpc..lat1".

>The '^M' at the end of each line isn't bad when the file has only 10 lines
>or so, but gets *really* annoying with bigger files...

Well, if you just want to get rid of that, apart from using tools like
recode, you could of course use tr, sed, ed, or vi to remove the trailing
^Ms in a bulk operation (like 1,$s/^M$// (^M being Ctrl+M, inserted via
Ctrl+V Ctrl+M here of course)) but if you have to do this more often,
a converter like recode is recommended.

I also expect there are native windows editors (apart from Unix ports)
that can save in Unix-style ASCII text but I can't name any right now.

mkb