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}'