03-31-04 05:40 PM
In comp.unix.misc Han JIANG <jianghanunl@yahoo.com> wrote:
> Hi,
> I am a newbie on unix. I met a strange problem here on Origin 2000.
> I created a text data file which had 1,000 lines on my pc (Windows of
> course) and upload it to my acoount on Origin.When I use vi to edit it on
> Origin, I found there is a additional blank line between every 2 lines!
> That makes my program cann't input this datafile.
Your "pc" ( running wintendo i assume ?) will use two characters
^M ( return ) and ^J ( line feed ) between lines. Un*x uses only ^J
but will sometimes present ^M as another line feed ( controlled by
the command "stty".
> Who know what happen here? And how can erase these additional blank lines?
> Please don't say erase them line by line since I have 1000 lines there.
Edit the file :-)
It's not so difficult, several tools are available
vi, tr dos2ascii etc..
Using "vi" :
> vi file
( file is opend, press ':' ( cursor will go to bottom line), type
1,$s/^V^M//g ( press return. ^V is made by holding control key while
pressing 'V', ^M is made by holding control while pressing 'M')
For a good introduction get "Essential System Administration" by eileen fris
h,
it contains lots of examples and is a good primer for unix knowledge.
> Thanks!
--
Peter Håkanson
IPSec Sverige ( At Gothenburg Riverside )
Sorry about my e-mail address, but i'm trying to keep spam out,
remove "icke-reklam" if you feel for mailing me. Thanx.
[ Post a follow-up to this message ]
|