"Fossies" - the Fresh Open Source Software Archive

Member "utrac-0.3.2/src/merge.pl" (4 Jan 2009, 1149 Bytes) of package /linux/privat/old/utrac-0.3.2.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "merge.pl" see the Fossies "Dox" file reference documentation.

    1 #!/usr/bin/perl
    2 # *************************************************************************
    3 #             merge.pl
    4 # 
    5 #   Tue Oct  5 12:22:33 2004
    6 #   Copyright  2004  Alliance MCA
    7 #   Written by Morad Igmir (and maintained by antoine@alliancemca.net)
    8 # **************************************************************************
    9 
   10 # This script merge a charmap file with an Unicode character description file
   11 
   12 
   13 sub usage()
   14     {
   15     print "Usage : merge.pl [charmap_file] [UnicodeData_file]\n" and exit ;
   16     }
   17 usage unless (@ARGV eq "2"); 
   18 die "error ( $! )" unless open (CHARMAP,$ARGV[0]);
   19 die "error ( $! )" unless open (UNICODE,$ARGV[1]);
   20 while (<UNICODE>)
   21     {
   22     chomp $_;
   23     $_ =~ s/\t//;
   24     @tablo1= split /\;/, $_;
   25     $octale=$tablo1[0];
   26     $control{$octale} = $tablo1[2];
   27     
   28     }
   29 close UNICODE;
   30 while (<CHARMAP>)
   31     {
   32     print $_ and next unless $_ =~/^0x/;
   33     chomp $_;
   34     @tablo2 = split /\t/,$_;
   35     my $var=uc(substr($tablo2[1],2,4));
   36     $var =~ s/\t//;
   37     chomp ($line= "$tablo2[0]\;$tablo2[1]\;$control{$var}\;$tablo2[2]$tablo2[3]$tablo2[4]");
   38     $line =~ s/\t//g;
   39     $line =~ s/\;/\t/g;
   40     print $line."\n";
   41     
   42     }
   43 close CHARMAP;
   44 print STDERR "\nC'est fini ##### va !!!\n";
   45 exit;