in reply to removing lines from a file
Hi,
Your whole coding is not good.
Try the below:
open (true, "< DATA.txt"); open (first, "> 1.out.text"); open (rest, "> 2.out.text"); $. <= 8 ? print first $_ : print rest $_ while(<true>);
DATA.txt
1 2 3 4 5 6 7 8 9 10
Update: true is included
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: removing lines from a file
by CountZero (Bishop) on Feb 18, 2005 at 11:27 UTC | |
|
Re^2: removing lines from a file
by Anonymous Monk on Feb 18, 2005 at 10:35 UTC | |
by gopalr (Priest) on Feb 18, 2005 at 10:41 UTC | |
by Anonymous Monk on Feb 18, 2005 at 10:39 UTC |