Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tlug: substituting a linefeed in vi
- To: tlug@example.com
- Subject: Re: tlug: substituting a linefeed in vi
- From: Chiew Farn Chung <cfchung@example.com>
- Date: Sun, 26 Jul 1998 21:44:19 -0400
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <XFMail.980726172652.schweiz@example.com>; from Jim Schweizer on Sun, Jul 26, 1998 at 06:26:52PM +0900
- References: <XFMail.980726172652.schweiz@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
On Sun, Jul 26, 1998 at 06:26:52PM +0900, Jim Schweizer wrote: > Hi all, > > I haven't had much luck figuring out how to substitute a DOS > carriage return with a new linefeed, ASCII code 10, in vi. > Something along the lines of > > :1,$ s/^M/?/ > > where ? is the linefeed. Can this be done? Hmmm... Let's see... top ten interesting ways of doing it :) 1.vi [file] :%s/control-Vcontrol-M$// :x 2.vim [file] :set notextmode :x 3.vim [file] :set fileformat=unix :x 4.perl -e 'while(<>){s_^M$__;print}' 5.perl -e 'print`dos2unix @example.com`' 6.perl -e 'exec dos2unix,@example.com' 7.perl -pe 's_^M$__;' 8.cat <file> | tr -d '\015' > <tmpfile> 9. dos2unix foo > bar 10. Or how about pico [file] [control-O] [enter] [control-X] (save file then exit) It works :) I bet windows can never ever find so many ways of doing it :) regards, Chiew p/s: By the way, the above is contributed by the computer science club members over in U of Waterloo :) -------------------------------------------------------------- Next Meeting: 8 August, Tokyo Station Yaesu central gate 12:30 featuring Linux on multiple platforms: i386, Sparc, PA-Risc, Amiga, SGI, Alpha, PalmPilot, ... Next Nomikai: September, 19:30 Tengu TokyoEkiMae 03-3275-3691 -------------------------------------------------------------- Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
- References:
- tlug: substituting a linefeed in vi
- From: Jim Schweizer <schweiz@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: tlug: NT joke
- Next by Date: RE: tlug: substituting a linefeed in vi
- Prev by thread: tlug: substituting a linefeed in vi
- Next by thread: RE: tlug: substituting a linefeed in vi
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links