1 |
root |
1.1 |
|
2 |
|
|
BEGIN { |
3 |
|
|
# Read the array data from living.c |
4 |
|
|
while ((getline buff < living_c) == 1) { |
5 |
|
|
if (buff ~ /spellpathnames\[/) { |
6 |
|
|
get_values(buff); |
7 |
|
|
fth = (tind-1)/4; |
8 |
|
|
for(i=1;i<tind;i+=5) |
9 |
|
|
printf("&%s &%s &%s &%s &%s & \\\\\n",array[i], |
10 |
|
|
array[i+1],array[i+2],array[i+3],array[i+4]); |
11 |
|
|
break; |
12 |
|
|
} |
13 |
|
|
} |
14 |
|
|
close(living_c); |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
function get_values (buff) { |
18 |
|
|
tind = 1; |
19 |
|
|
while (1) { |
20 |
|
|
getline buff < living_c; |
21 |
|
|
if (buff ~ /};/) |
22 |
|
|
break; |
23 |
|
|
gsub("[ \t]*\"", "", buff); |
24 |
|
|
nr = split(buff, val, ","); |
25 |
|
|
for (i = 1; i<=nr ; i++) |
26 |
|
|
if(val[i]!="") array[tind++]=val[i]; |
27 |
|
|
} |
28 |
|
|
} |