[19058] in s-news-athena

home help back first fref pref prev next nref lref last post

[S] Summary: using splus for web server log analysis

daemon@ATHENA.MIT.EDU (Don Turnbull)
Fri Aug 27 11:20:03 1999

Message-Id: <37C6A954.427065A2@fis.utoronto.ca>
Date: 	Fri, 27 Aug 1999 10:05:57 -0500
From: Don Turnbull <donturn@fis.utoronto.ca>
Reply-To: donturn@fis.utoronto.ca
Mime-Version: 1.0
To: "Herbert M. Bryant Jr." <herb.bryant@swfwmd.state.fl.us>,
        "s-news@wubios.wustl.edu" <s-news@wubios.wustl.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


"Herbert M. Bryant Jr." wrote:

> Mr. Turnbull-
>
> I'm curious about any answers you get to the attached question.
>
> -Herb Bryant

Unfortunately, I only got one response (and I guess that's enough to share -
shame on me) from the kind Dr. Boles:

here it is:

Don:

I am looking at .log files produced by a chat program and examining
text strings using the liwc (linguistic word count program). I
preprocess the files using a perl script to prepare the data for liwc.
I assume you could do something similar to preprocess the data into a
format that could be imported into splus via read.table or scan. Below
is the perl script I use. You could modify or roll your own. Perl is
_fast_ and handles large files.
...
===================================================================
#!/usr/bin/perl

## dnet program to:
#  read log file produced by chat program *.log
#  write  time user name, and text to *.log.liwc.txt file
#  only write lines with message text, including emoticon produced text
#  write message out in multiple lines with hard carriage returns



#########################
$arg = $ARGV[0];  # get file & path name
# print $arg;
@args = split(/\//,$arg); #print "@args\n";
$num_args = (@args); #print "$num_args\n";
$logfile = $args[$#args];
if ($num_args > 1) { $path = join('/', @args[0 .. $#args -1])."/";}
else {$path= "./";}
# print "$path\n$logfile\n";
##########################

 $logout = $path.$logfile.".liwc.txt";
print "Writing $logout \n from: $logfile\n";


# process logfile

open(LOGOUT,"> $logout") || die "cant open LOGOUT $!\n";

while(<>)
{   chop; s/\r//;        # using ascii files so strip carriage return
    $message= /^.* {.*} .+$/;
#    print "$message\n";
    if ($message == 1)
{                               # only convert records with messages
    ($weekday,$month,$day,$time,$year,$user, $braces, $rest)=
        /(^\S+) (\S+) (\S+) (\S+) (\S+) (\S+) ({.*}) (.*)/;
    $out = "$weekday $month $day $time $year $user $rest";
    print LOGOUT "$out\r\n" ; # write records with id info
#    print "$out\r\n" ;
}

    elsif (!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun).*{.*}$/)
{
   print  LOGOUT "$_\r\n";
#    print "$_\r\n";
}
}




-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post