Well, I have re-done my script : see below, but the computer just hangs and gives me a 0 file with nothing in it.
The text file called nosect.txt contains a list of words on seperate lines. The file Statutes.fff is a 400mb file which contains text in paragraph form. Where am I going wrong!!
!!Help
\#!/usr/local/bin/perl -w
%Acts = ();
#use Getopt::Long;
use strict;
my $filetoopen1 = 1;
my $filetoopen = 1;
my @WordList = 1;
my %Groups = 1;
my $TheLine = 1;
#####################
&Actsin1;
&Group;
#####################
sub Actsin1
{
$filetoopen1 = "c:/Update/nosect.txt";
open (ACTLIST, $filetoopen1) || die "Could not open file $filetoop
+en1 \n";
open (OUTPUT2,">c:/Update/Errors.txt") || die "Could not open outp
+ut \n";
dbmopen (%Groups, "c:/Update/Groups",0666) || die "Could not open
+Acts database\n";
@WordList = (<ACTLIST>);
}
#####################
sub Group
{
$filetoopen = "c:/update/makeme/statutes\.fff";
open (INPUT, $filetoopen) || die "Could not open file $filetoopen \n";
open (OUTPUT,">c:/update/makeme/newstat.fff") || die "Could not open o
+utput \n";
$TheLine = $_;
while (my $TheLine = <INPUT>)
{
if ($TheLine =~ /<RD>[^\n]*Status Compendium<<.JL>/i)
{
for(my $i=0; $i > @WordList; $i++)
{
print OUTPUT $TheLine if($TheLine ne $WordList[$i])
}
}
}
}
##################
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.