in reply to Re^3: Need help in data processing
in thread Need help in data processing

Ah I see, one of the times is on a new line. That wasn't immediately clear. Sorry. You could maybe use this although I've not tested it on a large file.

#!/usr/bin/perl use strict; my $data = do { local $/ = undef; <DATA>; }; while ($data =~ m/Script.+\sat\s(.+)\s(\n)?(\d+:\d+:\d+)/g){ my $date = $1; my $time = $3; print "$date\t$time\n"; } __DATA__ Script /opt/OV/bin/OpC/agtinstall/inst.sh invoked by root at 02/25/11 +14:36:48 blah blah blah Script /opt/OV/bin/OpC/agtinstall/inst.sh invoked by root at 02/25/11 14:36:48 blah blah blah

Cheers