M
Mr_Noob
Hi all,
here is an extract of my file :
2008/03/03 12:56:07 put /name_of_client4/pub/file.xml
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.mov
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.wmv
2008/03/03 12:56:07 put /name_of_client5/pub/file.xml
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.flv
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.jpg
2008/03/03 12:56:07 put /name_of_client2/pub/file.jpg
2008/03/03 12:56:07 put /name_of_client3/pub/file.xml
2008/03/03 12:56:07 put /name_of_client5/pub/file.mov
2008/03/03 12:56:07 put /name_of_client1/pub/file.xml
....
What would be the best way to grep for a specified "name_of_client"
then calculate the time since last file has been put ?
open( FILE, "< $filename" ) or die "Can't open $filename : $!";
while( <FILE> ) {
# grep last appearance of specified name_of_client
# time since last transfer
}
close FILE;
here is an extract of my file :
2008/03/03 12:56:07 put /name_of_client4/pub/file.xml
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.mov
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.wmv
2008/03/03 12:56:07 put /name_of_client5/pub/file.xml
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.flv
2008/03/03 12:56:07 put /name_of_client1/pub/videos/file.jpg
2008/03/03 12:56:07 put /name_of_client2/pub/file.jpg
2008/03/03 12:56:07 put /name_of_client3/pub/file.xml
2008/03/03 12:56:07 put /name_of_client5/pub/file.mov
2008/03/03 12:56:07 put /name_of_client1/pub/file.xml
....
What would be the best way to grep for a specified "name_of_client"
then calculate the time since last file has been put ?
open( FILE, "< $filename" ) or die "Can't open $filename : $!";
while( <FILE> ) {
# grep last appearance of specified name_of_client
# time since last transfer
}
close FILE;