User:Texas.william/perl/zomdic

From The Urban Dead Wiki
< User:Texas.william
Revision as of 21:45, 26 June 2009 by Texas.william (talk | contribs) (Code written to <span> id the entire kiZombie dictionary.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
#!/usr/bin/perl
open FIN,'data' or die "file not found";
@data=<FIN>;
close FIN;
print "$#data lines read.\n";

open FOUT,'>newdata' or die 'unable to open file newdata for writing';
foreach(@data) {
    if (! /^#/) {
        s|^'{3}(.*?)'{3}|<span id="$1">'''$1'''</span>|;
    }
    print FOUT;
}
close FOUT;

print "Operation completed.\n"