36 lines
530 B
Plaintext
36 lines
530 B
Plaintext
|
#!/bin/csh
|
||
|
awk '\
|
||
|
BEGIN {\
|
||
|
while (1) {getline; if ($0==" ") break;}\
|
||
|
nbsp=0;\
|
||
|
while (1) {\
|
||
|
getline < "header.in";\
|
||
|
if ($1=="end") break;\
|
||
|
for (i=0; i<$2; i++) {\
|
||
|
sp[nbsp]=$1;\
|
||
|
nbsp++;\
|
||
|
}\
|
||
|
}\
|
||
|
nbh=0;\
|
||
|
while (1) {\
|
||
|
getline < "header.in";\
|
||
|
if ($1=="end") break;\
|
||
|
h[nbh]=$0;\
|
||
|
nbh++;\
|
||
|
}\
|
||
|
at=0;\
|
||
|
}\
|
||
|
{\
|
||
|
if (at==0) {\
|
||
|
for (i=0; i<nbh; i++) {print h[i];}\
|
||
|
}\
|
||
|
print $0,sp[at]\
|
||
|
at++;\
|
||
|
if (at==nbsp) {\
|
||
|
at=0;\
|
||
|
print "end";\
|
||
|
print "";\
|
||
|
getline;\
|
||
|
}\
|
||
|
}'
|