I was tasked to get first 100 lines of records from a database dump. While searching big brother G, I found the solution here:- how to extract a range of lines from a file provided by zazzybob.

Here’s the solutions:-

You could also pipe though sed to extract the range – e.g.
blah | sed -n ‘1,1000p’ | blah
to extract the first 1000 lines of the file

How I uses it:-

cat file.unl | sed -n ‘1,100p’ > out100.unl

Cheers.

Discuss This / Comments

comments

 

Leave a Reply

Set your Twitter account name in your settings to use the TwitterBar Section.