Path: utzoo!mnetor!uunet!husc6!cca!mirror!ima!haddock!karl
From: karl@haddock.ISC.COM (Karl Heuer)
Newsgroups: comp.emacs
Subject: Re: transpose,rotate,mirror,reverse text...
Message-ID: <1932@haddock.ISC.COM>
Date: 10 Dec 87 17:41:29 GMT
References: <8129@steinmetz.steinmetz.UUCP>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 21
Summary: Use a separate program

In article <8129@steinmetz.steinmetz.UUCP> nieh@moose.steinmetz (nico nieh) writes:
>The following problems occurred to me yesterday while I was editing
>a file which contains matrices.
>
>1. Is there an easy way to transpose a matrix in GNU-Emacs ?
>2. Is there an easy way to rotate a rectangular of text +90/-90 degrees ?
>3. Is there an easy way to mirror a rectangular of text (vertical/horizontal) ?
>4. How about reverse a line or reverse a region ?
>
>Above questions should be applied to both character and word boundary.

I have a program called "flip" that transposes an input stream by character.
I find this very useful for doing column-oriented operations in an editor
where line-oriented operations are the norm.  The program also has an option
to use fixed-size rectangles of characters as the quantum (someday I should
add an option for tab-separated quanta).  Request by e-mail if you want the
source code.

It probably wouldn't be too difficult to do with an awk script, either.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint