How can I extract a range of lines from a text file on unix?

Posted by Adam J. Forster on Stack Overflow See other posts from Stack Overflow or by Adam J. Forster
Published on 2008-09-17T13:40:59Z Indexed on 2010/05/26 15:41 UTC
Read the original article Hit count: 141

Filed under:
|
|
|

I have a ~23000 line sql dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.

Does anyone know a unix command (or series of commands) to extract all lines from a file between say line 16224 and 16482 and then redirect them into a new file?

© Stack Overflow or respective owner

Related posts about unix

Related posts about command-line