Angus Leeming wrote:

> Jean-Marc Lasgouttes wrote:
>> The way to do this would be to add awk magic to the following
>> makefile target:
>> 
>>   $(srcdir)/xforms_l10n.pot:
>>   $(top_srcdir)/src/frontends/xforms/forms/*.fd
>>           awk ' \
>>                BEGIN { \
>>                        print "#, fuzzy"; \
>>                        print "msgid \"\""; \
>>                        print "msgstr \"\""; \
>>                        print "\"Content-Type: text/plain;
>>                        charset=ISO-8859-1\\n\""; \ print
>>                        "\"Content-Transfer-Encoding: 8bit\\n\""; \
>>                        print "\n"; \
>>                } \
>>                /label: / { \
>>                        if (NF > 1) { \
>>                                line=$$0;\
>>                                sub(/label: /,"",line);\
>>                                printf("#: %s:%d\nmsgid
>>                                \"%s\"\nmsgstr \"\"\n\n", FILENAME,
>>                                FNR, line);\
>>                        }\
>>                }' \
>>           `find $(top_srcdir)/src/frontends/xforms/forms -name
>>           \*.fd` > $@
>> 
>> Unfortunately, I know nothing about awk. Any taker?
> 
> Me neither, but how about
>                 style=0; \
>                 /style: / { \
>                         if (NF > 1) { \
>                                 style=$$0;\
>                                 sub(/style: /,"",style);\
>                         }\
>                 }' \
>                 /label: / { \
>                         if (NF > 1 && style == 15) { \
> 

That style=0 bit should be in the BEGIN block...

Also
                /label: / { \
                         if (NF > 1 && style == 15) { \
could become
                style != 15 && /label: / && NF > 1 { \

(I think, from a quick scan of O'Reilly's Unix in a nutshell.)
Angus

Reply via email to