File: modify.pl

package info (click to toggle)
golly 2.1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 9,560 kB
  • ctags: 5,064
  • sloc: cpp: 38,119; python: 3,203; perl: 1,121; makefile: 58; java: 49; sh: 22
file content (33 lines) | stat: -rwxr-xr-x 1,497 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/perl
@files = glob "*.htm" ;
for $file (@files) {
   open F, "$file" or die "Can't open $file\n" ;
   @f = <F> ;
   close F ;
   $f = join('', @f) ;
   for (($f)) {
      s/<body>/<body bgcolor="#FFFFCE">/g ;
      s!<center><a HREF="http://www.argentum.freeserve.co.uk/lex_home.htm">Life Lexicon Home Page</a>!<center><A HREF="lex.htm">Introduction</A> \| <A HREF="lex_bib.htm">Bibliography</A></center>!g ;
      s|<center><b class=l>Life Lexicon</b></center>||g ;
      s:^<A HREF="lex.htm">Introduction</A> \|:<font size=-1><b>:gm ;
      s:^<a href="lex.htm">Introduction</a> \|:<font size=-1><b>:gm ;
      s:<A HREF="lex_z.htm">Z</A> \|:<A href="lex_z.htm">Z</A></b></font>:g ;
      s:<a href="lex_z.htm">Z</a> \|:<A href="lex_z.htm">Z</A></b></font>:g ;
      s|^<A HREF="lex_bib.htm">Bibliography</A>||gm ;
      s|^<a href="lex_bib.htm">Bibliography</a>||gm ;
      s|<h3|<h5|g ; s|</h3|</h5|g ;
      s|<H3|<h5|g ; s|</H3|</h5|g ;
      s/^\t*//gm ;
      s/&times;/x/g ;
      s/&oacute;/o/g ;
      s|^<pre>|<center><table cellspacing=0 cellpadding=0><tr><td><pre><a href="lexpatt:">|gm ;
      s|^</pre>|</a></pre></td></tr></table></center>|gm ;
      # fix problems in lex_[hps].htm
      s|<a href="lexpatt:">\n-|<font size=-1>\n-|g ; s|-\n</a>|-\n</font>|g ;
      # fix problem in lex_l.htm
      s|<a href="lexpatt:">\nMar|<font size=-1>\nMar|g ; s|1973\n</a>|1973\n</font>|g ;
   }
   open F, ">$file" or die "Can't write $file\n" ;
   print F $f ;
   close F ;
}