From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: Find first line FOLLOWING a sequence of matches Date: Tue, 28 Apr 2015 22:37:06 -0700 (PDT) Message-ID: References: <29ab9e2e-0c7a-4b10-a701-a8796a17f790@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1430286019 13165 80.91.229.3 (29 Apr 2015 05:40:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2015 05:40:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 29 07:40:19 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YnKjK-0005i5-BZ for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 07:40:18 +0200 Original-Received: from localhost ([::1]:36996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnKjJ-0002ly-HJ for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 01:40:17 -0400 X-Received: by 10.66.90.230 with SMTP id bz6mr32761583pab.40.1430285827365; Tue, 28 Apr 2015 22:37:07 -0700 (PDT) X-Received: by 10.50.12.66 with SMTP id w2mr26494igb.11.1430285827326; Tue, 28 Apr 2015 22:37:07 -0700 (PDT) Original-Path: usenet.stanford.edu!l13no11457221iga.0!news-out.google.com!n7ni19954igk.0!nntp.google.com!l13no11457219iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <29ab9e2e-0c7a-4b10-a701-a8796a17f790@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=117.215.23.196; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 117.215.23.196 User-Agent: G2/1.0 Injection-Date: Wed, 29 Apr 2015 05:37:07 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:211781 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104063 Archived-At: On Wednesday, April 29, 2015 at 8:31:18 AM UTC+5:30, Rusi wrote: > On Tuesday, April 28, 2015 at 10:24:28 PM UTC+5:30, Subhan Michael Tindall wrote: > > Table like this: (abbreviated) > > |a|b|c| > > |a|d|e| > > |a|z|| > > |m|b|c| > > |m|c|d| > > |ab|c|d| > > First col is relevant (actual table is MUCH bigger) > > > > I'm looking to write a macro to convert this table (on an occasionally recurring basis) > > To something like: > > ,* a > > |a|b|c| > > |a|d|e| > > |a|z|| > > ,* m > > |m|b|c| > > |m|c|d| > > ,* ab > > |ab|c|d| > > > > The entries in first column are always strings of characters, no internal whitespace > > Looking for a way to search for the LAST match for a given element > > With that I should be able to macro-ize my keystrokes and save some time, or better yet come up with something to fully process the file > > > > EG: > > Insert ,* a header > > Search for a in column 1 > > Find the last a in the block > > Move down a line > > Copy m & insert ,* m header > > Search for m in column 1 > > > > > > Thousands of lines, hundreds of blocks, don't make me export this to excel and do it there! > > > > > > org or more specifically orgtbl should be able to do this. > Maybe ask on the org mailing list? Some part of the puzzle I had worked out here https://mail.python.org/pipermail/python-list/2013-September/666040.html Some more details will need to be worked out