PDA

View Full Version : Copying a specific number of records from one file to another


cobilan
03-27-03, 15:30
I have a huge file containing about 3 million records. I don't want to test using this huge file. I want to pull off the first 100 records from this file. Is there a command I can use to do this or will I have to write a script to do it?

I can use the SPLIT command and eventually get it down to 1000 records, but it takes a while.

Cobilan

sathyaram_s
03-27-03, 18:41
head command .....

man head

should give you more details ..

eg. head -100 bigfile > myfile

Cheers

Sathyaram


Originally posted by cobilan
I have a huge file containing about 3 million records. I don't want to test using this huge file. I want to pull off the first 100 records from this file. Is there a command I can use to do this or will I have to write a script to do it?

I can use the SPLIT command and eventually get it down to 1000 records, but it takes a while.

Cobilan

cobilan
03-27-03, 20:05
Thank you soooooooooo much!!! You've saved me a lot of time!

Cheers!!!

Cobilan :)