Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
while (<LOGFILE1>) { # parse the date field with the '|' delimiter @dateField = split(/\|/); # parse the activity field by matching '|1|'word space word @activityField = split(/\|1\|\w\s\w/); # Start populating the fields as appropriate $date = $dateField[0]; $activity = $activityField[0]; ## Write the cleaned up data to the data file print DATAFILE "$date , "; print DATAFILE "$activity ,"; print DATAFILE "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Expression help
by Roger (Parson) on Nov 11, 2003 at 23:39 UTC | |
by Anonymous Monk on Nov 12, 2003 at 00:54 UTC | |
by Roger (Parson) on Nov 12, 2003 at 01:06 UTC | |
|
Re: Regular Expression help
by davido (Cardinal) on Nov 12, 2003 at 05:44 UTC | |
|
Re: Regular Expression help
by ysth (Canon) on Nov 11, 2003 at 23:34 UTC |