in reply to Print all lines in a file except the last two
on my unix box.$lines = `/usr/bin/wc -l afile.txt`; open(F, '<afile.txt') || die 'cannot open afile.txt'; $cntr = 0; while (<F>) { $cntr++; print; last if $cntr == $lines - 2; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Print all lines in a file except the last two
by revdiablo (Prior) on May 20, 2004 at 19:16 UTC |