![]() |
Show a certain line in file
Hi everyone,
I have a very big text file with over 100 million rows. I want to look at rows 36,000,000 through 36,000,005 for example, how would I do that using the command line? Thanks. |
sed -n '36000000,36000005P' <logfile>
|
I am pretty sure that sed will do this. Here is the best sed tutorial I have seen:
http://www.grymoire.com/Unix/Sed.html A crude method is more +num filename. This starts on line "num", and continues one page at a time until stopped |
Thank you!
|
How about tail -n +36000000 <file> | head -n 5 ?
<edit> And, if you're going to be doing this frequently, consider making the file a data base table indexed on row number, and printing the lines you need with a SQL query. </edit> |
All times are GMT -5. The time now is 06:03 AM. |