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 40 41 42 43 44 45 46
|
BEGIN {
FS = ";";
from = -1;
name = "";
}
# For these lines:
# 3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;;
# 4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;;
/, First>/ {
from = $1;
split ($2, a, "[<,]");
getline;
print "0x"from"-0x"$1, a[2];
from = -1;
next;
}
# For succeeding same names.
/CJK COMPATIBILITY IDEOGRAPH|<control>/ {
if (from < 0)
{
from = $1;
if ($2 ~ "CJK")
name = "CJK COMPATIBILITY IDEOGRAPH";
else
name = "control";
}
to = $1;
next;
}
# For normal names.
{
if (from >= 0)
{
print "0x"from"-0x"to, name;
from = -1;
}
print "0x"$1, $2;
}
END {
if (from >= 0)
print "0x"from"-0x"to, name;
}
|