anyway, have fun!
--cut--
#!/usr/bin/perl
####################################################################
## quotes.pl - extracting Question and Context phrases from texts ##
## reads quotes from a file and writes them to STDOUT ##
## 2002 by Benjamin S Wiegele <kevi at freeshell dot org> ##
####################################################################
unless (@ARGV)
{
die "Syntax: $0 file [file2] [...]\n";
}
foreach $file (@ARGV)
{
open (FILE, $file) || die "Could not open $file: $!\n";
print '-' x 80 . "\n" . "From $file: \n" . '_' x 80;
while ( <FILE> )
{
# filter greater-thans, as they may appear in eMails an USENET postings.
# Note: we don't remove leading spaces for now.
$_ =~ s/\>//g;
if ( /_QUOTE_/ )
{
print "Quote: \n";
while ( <FILE> )
{
last if $_ eq "_QUOTE_\n";
print "\t" . $_;
}
}
elsif ( /_CONTEXT_/ )
{
print "Context: \n";
while ( <FILE> )
{
last if $_ eq "_CONTEXT_\n";
print "\t" . $_;
}
print "\n";
}
}
}
--cut--
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-]+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++.[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.