home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / SASSI / INDEX.PL < prev    next >
Text File  |  1997-03-05  |  2KB  |  53 lines

  1. $datafile = 'abbrtb.txt';
  2. $linkfile = 'linktb.txt';
  3.  
  4. foreach $title (a..z){
  5.     $filename = 'index' . $title . '.htm';
  6.     open(FILE, ">$filename");
  7.     $tmp = $title;
  8.     $title =~ tr/a-z/A-Z/;
  9.     printf FILE ("<HTML>\n<HEAD>\n\t<TITLE>'97最新略語辞典~%s~</TITLE>\n</HEAD>\n\n",$title);
  10.     printf FILE ("<BODY BGCOLOR=\"#ffffff\">\n");
  11.     printf FILE ("<A HREF=\"%s.htm\" target=\"data\"><IMG SRC=\"graphic/%s.gif\" ALT=\"[%s]\" WIDTH=\"32\" HEIGHT=\"32\" BORDER=\"0\"></A><BR>",$tmp, $tmp, $title);
  12.     printf FILE ("<P>\n<TABLE>\n");
  13. #    printf FILE ("<FONT SIZE=\"-1\">\n");
  14.     close(FILE);
  15. }
  16.  
  17. open(DATA, $datafile);
  18. while (<DATA>){
  19.     @line = split(/\t/, $_);
  20.     $key = $line[5]; #abbrkey
  21.     $abbrid{$key} = $line[0];
  22.     $abbr{$key} = $line[1];
  23.     $categoryid{$key} = $line[2];
  24.     $letter{$key} = $line[3];
  25.     $description{$key} = $line[4];
  26.     $abbrkey{$key} = $line[5];
  27.     $hypertext{$key} = $line[6];
  28.     $abbrname{$key} = $line[1];
  29.  
  30.     $abbridindex{$abbrid{$key}} = $abbrkey{$key};
  31. }
  32. close(DATA);
  33.  
  34. foreach $i (sort(keys %abbrkey)){
  35.     $head = substr($abbrkey{$i}, 0, 1);
  36.     $head =~ tr/A-Z/a-z/;
  37.     $href = $head . '.htm#' . $abbrkey{$i};
  38.     $file = 'index' . $head . '.htm';
  39.     open(FILE, ">>$file");
  40.     printf FILE ("<TR><TD><A HREF=\"%s\" TARGET=\"data\">%s</A><BR>\n",$href,$abbr{$i});
  41.     close(FILE);
  42. }
  43.  
  44. foreach $title (a..z){
  45.     $filename = 'index' . $title . '.htm';
  46.     open(FILE, ">>$filename");
  47. #    printf FILE ("</FONT>\n");
  48.     printf FILE ("</TABLE>\n");
  49.     printf FILE ("\n</BODY>\n</HTML>\n");
  50.     close(FILE);
  51. }
  52.  
  53.