I have one file with 500 lines in it. i want to split that file into 5 file each should contain 100 lines.
i used delimiter after every hunder lines and i am able to split file into 5 files.
Now what i want is...
Instead of delimiter i want to count number lines in a file.then split that file qually into 5 files..
Please help me in doing this one
spliting file code using delimiter.
my $fil_count = 0;
my $delim = 'test';
open IN, '< test1.txt' or die "Can't open in.txt: $!\n";
open OUT, '> Out0.txt' or die "Can't write to out0.txt: $!\n";
print OUT $1 if $1;
open OUT, '> Out' . $fil_count . '.txt' or die "Can't write to out
print OUT $2 if $2;
print OUT $_;