UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2009-01-09 12:20 PM

Jana
Member
Registered: 2008-03-24
Posts: 21

Re: spliting the large size file

HI
I have a very large file which has size of 25GB, with this size I am not able to open this file. so tried to split the file into two pieces but I do not have enough space in my system for new files getting created.

Actually I am interested only in the last 1000 lines in this file. How can get only last 1000 lines of this file to a new file ??? Please let me know how to achieve this.

I searched in the web but I did not find example for this case.

Thanks
Jana

Offline

#2 2009-01-09 01:46 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,847
Website

Re: spliting the large size file

Offline

#3 2009-01-10 01:45 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: spliting the large size file

See also the comment about O_LARGEFILE in the open(2) manpage,
and then you can seek to the end of it with fseek.

Offline

Board footer

Powered by FluxBB