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
    But it doen't take into account the data in the cut_out file.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re^2: removing lines from a file
by Anonymous Monk on Feb 18, 2005 at 10:35 UTC
    the output files are empty? when u use the above

      Here it's working fine. I don't know what u do.

      Just copy the coding and run it.

      Still if u face the problem again, let me know.

      oooppps <DATA> shoule be <true> so how can i next remove the following two lines, bearing in mind that i may have 30 or so continous deletions to perform?