Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
> qt_l10n.pot: $(top_srcdir)/src/frontends/qt2/ui/*.ui
>       LC_ALL=C ; export LC_ALL ; \
>       $(AWK) -v top_srcdir="$(top_srcdir)" ' \
>               function fixupfilename() \
>               {\
>                       return substr(FILENAME, length(top_srcdir "/") + 1);\
>               }\
>               /<string>/ { \
>                       line=$$0; \
>                       sub(/.*<string>/, "", line); \
>                       sub(/<\/string>.*/, "", line); \
>                       gsub(/&amp;/, "\\&", line); \
>                       gsub(/&lt;/, "<", line); \
>                       gsub(/&gt;/, ">", line); \
>                       gsub(/"/, "\\\"", line); \
>                       if (length(line) > 0) {\
>                               printf("#: %s:%d\nmsgid \"%s\"\nmsgstr 
\"\"\n\n",\
>                                       fixupfilename(), FNR, line); \
>                       } \
>               }' \
>       ${top_srcdir}/src/frontends/qt2/ui/*.ui > $ <at> 

I'm not very good at awk, but why don't you save the previous line:

BEGIN
{
        previousline=""
}
{
        if $previousline ~ /<property name="caption">/! {
                /<string>/ {
                        ...
                }
        }
        previousline=$line
}

In fact, do you even need to use the pattern matching operator ~ ? Would a 
simple
        if $previousline != "<property name=\"caption\">" {
work?

Angus

Reply via email to