Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!sunic!liuida!isy!sssab!matoh From: matoh@sssab.se (Mats Ohrman) Newsgroups: comp.emacs Subject: Re: Two EMACS Questions Message-ID: <1989Sep12.091346.27443@sssab.se> Date: 12 Sep 89 09:13:46 GMT References: <574@ajpo.sei.cmu.edu> Organization: Scandinavian System Support AB (3S AB) Lines: 45 [ Reposting this because of that &#%#&&/#&%**{} "Re^2"-killer. - Mats ] shirono@ssd.harris.com (Roberto Shironoshita) writes: >In article <574@ajpo.sei.cmu.edu> eberard@ajpo.sei.cmu.edu (Edward Berard) >> 2. I have a large (approximately 600 lines) file. Each line in >> the file looks like two strings separated by a tab. Since >> the length of the first string varies, the tab is not in >> the same place in each line. Is there any way to tell emacs >> to take every line in the file and cause the second string >> in each line to begin at the same column? >Assuming the file has already been created, it is possible to tell GNU >Emacs to do anything you want with it. The only problem for most >non-hackers is in getting GNU Emacs to understand you (swearing and cursing >don't work ;-). You could, for example, define a keyboard macro and then >invoke it for each and every line in the file (or invoke it with a >repeat-count). The GNU Emacs Manual for version 18 has a whole section >devoted to keyboard macros. You could also write some GNU Emacs Lisp code >to do exactly what you want. Unfortunately, I know of no simple way. To do it with a macro: C-X ( C-S C-Q TAB /* search for TAB */ ESC /* found it! */ DEL /* then remove it */ M-X indent-to-column C-X ) then: M-< C-U C-X E Elementary, my dear Watson :-) :-) :-) -- _ : matoh@sssab.se / Mats Ohrman, : {mcvax,munnari,uunet}!sunic!sssab!matoh Scandinavian System Support AB, : Phone: Nat. 013-11 16 60 Box 535, S-581 06 Linkoping, Sweden : Int. +46 13 11 16 60