BEGIN { # Sorry, but most awk's are not able to deal with double quotes... doublequote=sprintf("%c",34); handle=1 FS="@" #{{{}}} # {{{ print auto-gen-mark print("/* This file is generated automatically by awk -f msg2c.awk */\n/* containing the message name strings for OCL messages */") # }}} print("char const * const msg_list[]={") print(" "doublequote"(not-used)"doublequote",") } /^RC-COMPRESSION-DATA *$/ { handle=0 } handle==0 { next } $1 !~ /^((#)|((STR)|(MSG)_.*))/ { name=$1 while ((name!="") && (substr(name,length(name),1)==" ")) name=substr(name,1,length(name)-1) print(" "doublequote name doublequote",") } END { printf(" 0};\n") }