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