Hi I tried with below code calling scripts as ./scriptname srcfile.txt. But it deleted just the first line. Not last 2 lines/1 line </p?
#!/usr/bin/perl my $file='jjl.exec.txt'; open STDOUT, ">", $file or die "$0: open: $!"; open STDERR, ">&STDOUT" or die "$0: dup: $!"; <>; while($line = <>) { print if defined; $_ = $line; }
In reply to Re^2: Deleting first and last lines of a text file
by vsmeruga
in thread Deleting first and last TWO(2) lines of a text file
by vsmeruga
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |