Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!pasteur!ucbvax!ECLA.USC.EDU!BEC.SHAPIN From: BEC.SHAPIN@ECLA.USC.EDU (Ross Watkins) Newsgroups: comp.sys.apollo Subject: How to cut and paste a column Message-ID: <12384916270.13.BEC.SHAPIN@ECLA.USC.EDU> Date: 24 Mar 88 16:56:58 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 45 Rick Allard asks: > Has anybody found the need and the solution > to cutting a column out of a multicolumn > area of characters, a table? Any Display > Manager Jockeys that can help, I'd like to > [unreadable...I think it said "buy them lunch"] I'm hardly a DM Jock, but I have been squeezing DM for awhile, trying to get it to look more like EMACS; we have the stuff from MIT, but I haven't had time to get it up and working. To cut a rectangular are out of any text file, first mark the top-left corner, then cursor down to the bottom-right. Everything in between will reverse-video, including the stuff outside your rectangle that you don't want, but don't worry. Now use the DM command "XD -R", which will cut the rectangular section from the text, and hold it in the paste buffer. The inverse operation--pasting a column into the middle of a table--is done with the companion command "XP -R" (don't use the PASTE key!); bear in mind that if things don't line up exactly, you will have some reformatting to do. I use the rectangular-cut command often when coding: to delete the first four spaces from 20 lines in a row, say, as when removing a FOR loop or other level of code. I use it so much, in fact, that I have bound the sequence to CNTL-W (for cut-window) with the DM command "KD ^W XD -R KE", in order to have it easily accessible. The corresponding copy command is "XC -R", but I have never used it. Also note that by appending "-F pathname" to these DM commands, the resulting cut/copy/paste can be written/written/read to/to/from the pathname specified. Please also note that the "rectangle switch" need not be present to make use of this pathname redirection switch. Indeed, it is in precisely this manner that "-F pathname" finds its greatest utility for me--and a few more bindings: cut to a file: "KD ^D XD -F &'Cut and copy to Pathname: ' KE" copy to a file: "KD ^C XC -F &'Copy to Pathname: ' KE" paste from a file: "KD ^I XP -F &'Insert from Pathname: ' KE" I find the prompts useful for remebering what I bound to what, and in case of typing error. Play with these until you are comfortable with them. Enjoy, Ross -------