-
Notifications
You must be signed in to change notification settings - Fork 2
/
get_essential
executable file
·39 lines (39 loc) · 1021 Bytes
/
get_essential
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
gawk '
BEGIN {
skip=1;fopen=0;linenumb=0;
}
/^begin/ { skip=0;card=0; next}
/^end/ { skip=1; next}
{
if (skip==1){
i0=match($0,/Input File/); i1=match($0,/\:/); i2=match($0,/\(/);
if (i0>0 && i1 > 0 && i2>0){
fname=substr($0,i1+1,i2-i1-1);
printf("Extract the essential part of file %s.\n",fname);
getline line < fname;
fopen=1;
while (match(line,/begin/)==0) {
getline line <fname
}
getline dim <fname; split(dim,dvec);
printf("V-representation\nbegin\n");
printf(" ******** %s %s\n", dvec[2], dvec[3])
}
}
if (fopen && skip==0) {
getline line <fname;
linenumb++;
}
if (skip==0 && $2=="e:" ){
card=card+1;
printf("%s #%d\n",line, linenumb);
if (linenumb!= +$1) printf("unmatching line numbers!!!\n")
}
}
END {
printf("end\nhull\n");
printf("*You must edit this output before running cdd\n");
printf("*by replacing ******** above by no of points below:\n");
if (card > 0) {printf("no of lines = %1s\n", card);}\
else {printf("no appropriate data\n")}
}'