Article View: news.software.nntp
Article #3290Reading the history file backwards
From: Erland Sommarskog
Date: Fri, 27 Jan 1995 11:47
Date: Fri, 27 Jan 1995 11:47
25 lines
1824 bytes
1824 bytes
This is what I want to do: I want to read the last lines in my history until I come to a line which fulfils some condition, say arrival time less than an hour ago. The aim is to collect statistics on travel time for the articles, from posting to arrival at our site. I figured that if there is a utility which prints the lines in file in the reverse order, I would have what I'm looking for, but since the history file is huge, 43 MB, there is a catch: the utility has to work like tail, position itself at the end of the file and the read backwards. Saying "print reverse <>" like in the Camel book won't do. Now, does anyone know a program which does this, or have any library routine to share? Perl is preferred, but a C routine is helpful to. Please mail anything you post, as our newsfeed is unrealiable at the moment. (Would you believe it? We're directly on the Internet, and yet it takes days for articles to arrive here.) -- Erland Sommarskog, sommar@enea.se, Stockholm "Person-person - a politically correct designation of 'mail-man'" Wiley's Dictionary
Technical Details
Message-ID:
<3gamfk$hsl@gordon.enea.se>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!howland.reston.ans.net!news.sprintlink.net!pipex!sunic!seunet!seunet!news2.swip.net!enea.se!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <3gamfk$hsl@gordon.enea.se> Subject: Reading the history file backwards Date: Fri, 27 Jan 1995 11:47:00 +0000 From: sommar@enea.se (Erland Sommarskog) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!howland.reston.ans.net!news.sprintlink.net!pipex!sunic!seunet!seunet!news2.swip.net!enea.se!not-for-mail Newsgroups: news.software.nntp,comp.lang.perl Organization: Foresta dell'estate Lines: 24 Distribution: inet NNTP-Posting-Host: gordon.enea.se