1 #!/usr/local/bin/perl -w
4 $tagtofilemap{"kCNS1986-1" } = IO
::File
->new("|sort> cns1986p1.txt")
5 or die "cannot open cns1986p1.txt";
6 $tagtofilemap{"kCNS1986-2" } = IO
::File
->new("|sort> cns1986p2.txt")
7 or die "cannot open cns1986p2.txt";
8 $tagtofilemap{"kCNS1986-E" } = IO
::File
->new("|sort> cns1986p14.txt")
9 or die "cannot open cns1986p14.txt";
10 $tagtofilemap{"kCNS1992-1" } = IO
::File
->new("|sort> cns1992p1.txt")
11 or die "cannot open cns1992p1.txt";
12 $tagtofilemap{"kCNS1992-2" } = IO
::File
->new("|sort> cns1992p2.txt")
13 or die "cannot open cns1992p2.txt";
14 $tagtofilemap{"kCNS1992-3" } = IO
::File
->new("|sort> cns1992p3.txt")
15 or die "cannot open cns1992p3.txt";
16 $tagtofilemap{"kIRG_TSource-1" } = IO
::File
->new("|sort> cnsIRGTp1.txt")
17 or die "cannot open cnsIRGTp1.txt";
18 $tagtofilemap{"kIRG_TSource-2" } = IO
::File
->new("|sort> cnsIRGTp2.txt")
19 or die "cannot open cnsIRGTp2.txt";
20 $tagtofilemap{"kIRG_TSource-3" } = IO
::File
->new("|sort> cnsIRGTp3.txt")
21 or die "cannot open cnsIRGTp3.txt";
22 $tagtofilemap{"kIRG_TSource-4" } = IO
::File
->new("|sort> cnsIRGTp4.txt")
23 or die "cannot open cnsIRGTp4.txt";
24 $tagtofilemap{"kIRG_TSource-5" } = IO
::File
->new("|sort> cnsIRGTp5.txt")
25 or die "cannot open cnsIRGTp5.txt";
26 $tagtofilemap{"kIRG_TSource-6" } = IO
::File
->new("|sort> cnsIRGTp6.txt")
27 or die "cannot open cnsIRGTp6.txt";
28 $tagtofilemap{"kIRG_TSource-7" } = IO
::File
->new("|sort> cnsIRGTp7.txt")
29 or die "cannot open cnsIRGTp7.txt";
30 $tagtofilemap{"kIRG_TSource-F" } = IO
::File
->new("|sort> cnsIRGTp15.txt")
31 or die "cannot open cnsIRGTp15.txt";
32 $tagtofilemap{"kIRG_TSource-3ExtB" } = IO
::File
->new("|sort> cnsIRGTp3ExtB.txt")
33 or die "cannot open cnsIRGTp3ExtB.txt";
34 $tagtofilemap{"kIRG_TSource-4ExtB" } = IO
::File
->new("|sort> cnsIRGTp4ExtB.txt")
35 or die "cannot open cnsIRGTp4ExtB.txt";
36 $tagtofilemap{"kIRG_TSource-5ExtB" } = IO
::File
->new("|sort> cnsIRGTp5ExtB.txt")
37 or die "cannot open cnsIRGTp5ExtB.txt";
38 $tagtofilemap{"kIRG_TSource-6ExtB" } = IO
::File
->new("|sort> cnsIRGTp6ExtB.txt")
39 or die "cannot open cnsIRGTp6ExtB.txt";
40 $tagtofilemap{"kIRG_TSource-7ExtB" } = IO
::File
->new("|sort> cnsIRGTp7ExtB.txt")
41 or die "cannot open cnsIRGTp7ExtB.txt";
42 $tagtofilemap{"kIRG_TSource-FExtB" } = IO
::File
->new("|sort> cnsIRGTp15ExtB.txt")
43 or die "cannot open cnsIRGTp15ExtB.txt";
45 $nonhan = IO
::File
->new("< nonhan.txt")
46 or die "cannot open nonhan.txt";
48 while(defined($line = $nonhan->getline()))
50 $tagtofilemap{"kCNS1986-1"}->print($line);
51 $tagtofilemap{"kCNS1992-1"}->print($line);
52 $tagtofilemap{"kIRG_TSource-1"}->print($line);
60 ($u,$tag,$value) = split(/\t/,$_);
61 if($tag =~ m/(kCNS|kIRG_TSource)/)
63 ($pnum, $cvalue) = split(/-/,$value);
64 $tagkey = $tag . "-" . $pnum;
68 $fd = $tagtofilemap{$tagkey};
70 $mapping = substr($u,3,4); # trunkcate 0x2 from 0x2abcd
72 $mapping = substr($u,2,4); # trunkcate 0x from 0xabcd
74 $fd->print("0x" . $cvalue . "\t0x" . $mapping . "\t# <CJK>\n");