[Xastir] Time stamping?

J. Lance Cotton joe at lightningflash.net
Tue Apr 1 23:08:18 EST 2003


I'm definitely no Perl hacker, but I coded up this bit of perl which opens up 
a file called 'tnc.log', prepends each non-timestamp line with the most 
recent timestamp entry and a tab character, and writes the new line out to a 
file called 'tnc_processed.log'.

----------------------SNIP-------------------
$inputfile = "<tnc.log";
$outputfile = ">tnc_processed.log";
my $currtime;

open inputfile or die "Can't open file $inputfile: $!\n";
open outputfile or die "Can't open file $inputfile: $!\n";
while ($line = <inputfile>) {
  if ($line =~ /^# .*/) {
    chomp($line);
    $currtime = $line;
    print $currtime."\n";
  }
  else {
    print outputfile $currtime . "\t" . $line;
  }
}

close inputfile;
close outputfile;
----------------------SNIP------------------

I am positive it can be done in one or two lines, but I don't breathe Perl ;-)

-Lance KJ5O

On Tuesday 01 April 2003 20:44, Greg Jurrens wrote:
> Ok....We've caught the data AE5PL wanted.....
> Now, How can I GREP both the lines that have his data AND the Time hacks to
> a common file?  We're trying to time correlate the data.
>
> Thanks,
> Greg Jurrens
>
> Greg can't GREP worth GUNK!
>
>
> On Tue, 01 Apr 2003 10:26:31 -0600
>
> Gerry Creager N5JXS <gerry.creager at tamu.edu> wrote:
> > I *WANT* one of those!
> > gerry
> >
> > Dick C. Reichenbach wrote:
> > > I'm calling animal control dammit!
> > >
> > > Reminds me of a bumper sticker I saw a long time ago lamenting the poor
> > > quality of computer education.  "Why Johnny Can't Grep"
> > >
> > > Dick R. - KC8OBZ
> > >
> > > "Kurt A. Freiberger" wrote:
> > >>I grepped my cat till it awked
> > >>Thanks,
> > >>Kurt
> > >>
> > >>--
> > >>Kurt A. Freiberger     Austin, TX       kurt at badgers-hill.net
> > >>Amateur Radio Callsign WB5BBW           AIM Handle: WB5BBW
> > >
> > > _______________________________________________
> > > Xastir mailing list
> > > Xastir at xastir.org
> > > http://krypton.hscs.virginia.edu/mailman/listinfo/xastir
> >
> > --
> > Gerry Creager -- gerry.creager at tamu.edu
> > Network Engineering -- AATLT, Texas A&M University
> > Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.847.8578
> > Page: 979.228.0173
> > Office: 903A Eller Bldg, TAMU, College Station, TX 77843
> >
> > _______________________________________________
> > Xastir mailing list
> > Xastir at xastir.org
> > http://krypton.hscs.virginia.edu/mailman/listinfo/xastir

-- 
J. Lance Cotton, KJ5O
Three Step Plan: 1. Take over the world. 2. Get a lot of cookies. 3. Eat the 
cookies.



More information about the Xastir mailing list