Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
In the above file I would want: Friday, 08/25/2006 14:15Friday, 08/25/2006 13:56 Friday, 08/25/2006 13:57 Friday, 08/25/2006 14:10 Friday, 08/25/2006 14:15
my $file = 'oratabtest.txt' open FILE, "< $file" or die; my @lines = <FILE>; open FILE, "> $file" or die; foreach (@lines) { if (#something to fetch last line) { print $lastline; } } print "here is last line: $lastline";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grab last line and print
by Not_a_Number (Prior) on Aug 25, 2006 at 18:44 UTC | |
by Anonymous Monk on Aug 25, 2006 at 19:21 UTC | |
|
Re: Grab last line and print
by jwkrahn (Abbot) on Aug 25, 2006 at 18:32 UTC | |
|
Re: Grab last line and print
by madbombX (Hermit) on Aug 25, 2006 at 18:36 UTC | |
|
Re: Grab last line and print
by radiantmatrix (Parson) on Aug 25, 2006 at 20:14 UTC | |
|
Re: Grab last line and print
by planetscape (Chancellor) on Aug 26, 2006 at 07:46 UTC | |
|
Re: Grab last line and print
by derby (Abbot) on Aug 25, 2006 at 18:32 UTC | |
|
Re: Grab last line and print
by Jenda (Abbot) on Aug 25, 2006 at 18:36 UTC | |
|
Re: Grab last line and print
by izut (Chaplain) on Aug 28, 2006 at 10:54 UTC | |
|
Re: Grab last line and print
by o2bwise (Scribe) on Aug 25, 2006 at 18:32 UTC |