From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: PO-mode help, please Date: Tue, 22 Feb 2005 12:51:23 -0700 Message-ID: <381gpvF5gbnrbU1@individual.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1109101971 25778 80.91.229.2 (22 Feb 2005 19:52:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Feb 2005 19:52:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 22 20:52:51 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D3g5E-00052n-Ax for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2005 20:52:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D3gMR-0001kD-9L for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2005 15:10:23 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-X-Trace: individual.net 9XU4hpgpxts5clvYDA7OAQGaLHb7f8Tg1fZnCb8murFw6RZHs= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:128721 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:24259 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24259 Tim Morley (forstreku la legoman koloron de mia retadreso) wrote: > I need to find each record that includes the comment below: > # FAKVORTO: MATEMATIKA > msgid "Absolute Value" > msgstr "Absoluta Valoro" > > It may appear as one of several comments, in which case I need to copy > over all of the comments: > # Aux ALD (laux la franca AJT)? (Gian Piero SAVIO, 2004-04-02) > # 'ALDONI' estas plej klara; 'ALD' iom malpli, do konservu la unuan. > (Tim Morley, 2004-04-03) > # FAKVORTO: MATEMATIKA > msgid "ADD" > msgstr "ALDONI" > > And the comments may not appear in any particular order: > # Nur la franca uzas verban terminon, cxiuj aliaj uzas substantivan > terminon. Atentu, "Combine" povus havi aritmetikan signifon, kies > preciza traduko estas "Kombinacio" (mi intertempe kontrolis en PIV1). > (Leo DC, 2004-08-13) > # Vi pravas, ke estas cxiutaga kaj matematika sencoj por tiu vorto. > Mi enmetos ambaux. (Tim Morley, 2004-09-23) > # FAKVORTO: MATEMATIKA > # PLURSENCAJXO > # Kombinajxo > msgid "Combination" > msgstr "Kunigado" > > If somebody could suggest either an EMACS keyboard macro, or possibly a > SED or AWK script, that would spit out a text file containing all of the > above records from my collection of files, it would be a great help to me. I think awk is the way to go: awk '/^#/ {comment[c++] = $0} /^# FAKVORTO: MATEMATIKA/ {verify = 1} /^msgid/ {msgid = $0} /^msgstr/ {if (verify == 1) { for (l=0; l