how to get the data from line number 1 to line number 100 of a file

Hi Everybody,
I am trying to write a script that will get some perticuler data from a file and redirect to a file.

My Question is,
I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line.
I know the line numbers, I need to get all the data started from 25th line to 100th line. How to do that with Shell script?

sed -n 25,100p  file

Or may be:

sed -n 25,100p\;101q file

If you have a very huge file this is an awk variation of the 2nd sed solution of radoulov:

awk 'NR>100{exit}NR>24' file

cat filename.dat | head -100 | tail -75 >> newfilename.dat

or

you can do by using awk also

awk 'NR==25,NR==100' filename.dat >> newfilename.dat

caught you :wink:

cat filename.dat | head -100 | tail -75 >> newfilename.dat

UUOC

Well, what about reading a part of the line? I tried this:

 sed '/exp1/,/exp2/p' text.txt 

But it returned whole file.

try this:
head -100 filename | tail -75

try
head -100 file | tail -75 > outfile

sed -n 1,100 file1 > file2

sed -n '1,100p' file1 > file2