home *** CD-ROM | disk | FTP | other *** search
- From: kevinl@tisdec.tis.tandy.com
- Date: 18 Aug 92 09:08 CDT
- Newsgroups: comp.editors
- Subject: Re: Switching cols in VI
- Message-ID: <4900001@tisdec.tis.tandy.com>
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!sdd.hp.com!usc!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!seas.smu.edu!utacfd.uta.edu!trsvax!trsvax!tisdec.tis.tandy.com!kevinl
- Nf-ID: #N:tisdec.tis.tandy.com:4900001:000:361
- Nf-From: tisdec.tis.tandy.com!kevinl Aug 18 09:08:00 1992
- Lines: 19
-
-
- If you don't want to worry about how many columns you have,
- you can use the following awk program.
-
-
- {
- for( i = 0; i < NF; i++ ) {
- printf "%s", $(NF - i)
- if( i != NF - 1 )
- printf " "
- }
- print ""
-
- }
-
- It just starts at the end and works backwards. The 'if' is there
- so that it doesn't put spaces at the end of your lines. Hope this
- helps you out. 8-)
-
-