Here is a little alias I created for my korn shell... it uses perl..
alias rmm='perl -i -pe '''s/\r//''''
Then you type "rmm <filename>" and it strips off all the damn ^M's....
-----Original Message-----
From: Mike Sphar [mailto:mike.sphar@peregrine.com]
Sent: Wednesday, January 16, 2002 9:55 AM
To: toasters@mathworks.com
Subject: RE: ascii files convertion UNIX <--> windows ?
If Windows users just need to read (not write) UNIX files sometimes, Wordpad
will do that just fine.
--
Mike Sphar - Sr Systems Administrator - Engineering Support
Peregrine Systems, Inc.
-----Original Message-----
From: Steve Losen [mailto:scl@sasha.acc.virginia.edu]
Sent: Wednesday, January 16, 2002 7:28 AM
To: Frank Bonnet
Cc: toasters@mathworks.com
Subject: Re: ascii files convertion UNIX <--> windows ?
> Hi
>
> After success in accessing UNIX homedir from windows
> ( thanks to all that respond ) I am facing a problem
> with ascii file conversion
>
> An ascii file created under UNIX cannot be viewded
> correctly under windows ( CR LF conversion ) is there an
> option with Ontap to convert ascii files when opening
> them under windows and vice-versa ?
>
> Thanks a lot.
The filer does not do any data conversion that I am aware of.
In our experience we have found that folks who use both Windows and Unix
do not often manipulate the same file on both systems. Usually Windows
files are only manipulated from Windows and Unix files only from Unix.
However, we do recommend installing NoteTab Light on Windows and using
that instead of standard Windows NotePad. NoteTab accepts all three
text file line terminators: LF (unix) CRLF (dos) CR (Apple) and will
generate output using any of these. So you can keep a file in its
original format or convert it.
http://www.notetab.com
On the Unix side, Solaris has the "flip" command that converts a text
file from LF to CRLF and vice versa. This utility may be available on
other flavors of Unix, too.
If you don't have flip, here is a trivial awk command to convert
unix to dos by adding CR to each line:
awk '{print $0 "\r"}' unixfile > dosfile
Here is a trivial sed command to convert dos to unix by stripping the
CR at the end of the line.
sed 's/.$//' dosfile > unixfile
On Linux, vi (vim) detects the line terminator style and preserves it.
And you can also force dos line terminators with the vi command
:set fileformat=dos or :set ff=dos
To force unix use
:set fileformat=unix or :set ff=unix
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support
----------------------------------------- (on rchss001)
This e-mail and any files transmitted with it are the property
of Chiaro Networks, Ltd., and may contain confidential and
privileged material for the sole use of the intended recipient(s)
to whom this e-mail is addressed. If you are not one of the named
recipient(s), or otherwise have reason to believe that you have
received this message in error, please notify the sender and
delete all copies from your system. Any other use, retention,
dissemination, forwarding, printing or copying of this e-mail is
strictly prohibited.
---------------------------------------------------------