develooper Front page | perl.beginners | Postings from April 2008

Re: Best way to grab lines n thru x of a file

Thread Previous
From:
Mathew
Date:
April 10, 2008 09:48
Subject:
Re: Best way to grab lines n thru x of a file
I think a simpler solution would be to use head and tail:

head -n x > file.txt
tail -n x-n file.txt > file2.txt


Xavier Noria wrote:
> On Apr 10, 2008, at 18:24 , Jonathan Mast wrote:
> 
>> Hi, I have a ~125MB file of which I want to read lines n thru n+x and 
>> write
>> those into a separate file.  What is the best way to go about this?
> 
> Tie::File
> 

-- 
"If you do things right people won't be sure you've done anything at all."

Keep up with me and what I'm up to: http://theillien.blogspot.com

Thread Previous


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About