help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PO-mode help, please


From: Tim Morley (forstreku la legoman koloron de mia retadreso)
Subject: Re: PO-mode help, please
Date: Tue, 22 Feb 2005 22:44:18 GMT
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Kevin Rodgers wrote:
Tim Morley wrote:
 > I need to find each record that includes the comment below:
 > ...
 > 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<c; l++)
                    print comment[l]
                  print msgid
                  print
                  }
                c = 0
                verify = 0}'


Sterling work, sir! Thanks aplenty for that. All strings now extracted and winging their way to our experts. :o)

Somebody buy that man a beer.

Tim

reply via email to

[Prev in Thread] Current Thread [Next in Thread]