Sashidhar wrote:
> 
> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> > Sashidhar wrote:
> > >
> > > I am dealing with text files of sizes > 2 GB. I have to modify just the top 2
> > > lines of such files. Is there a way in Perl to modify just the first 'n' lines
> > > of the file without having to process rest of the file as it involves a lot of
> > > IO and time.
> >
> > It depends.  If the modifications don't change the length of the file
> > then you can do it.  If the modifications increase or decrease the
> > length of the file then you have to process the entire file.
> 
> I may have to change the length of the files. Is there no way, like manipulating the
> inode entries to reflect any changes in the length. Ofcourse, I realize that this is
> specific to the linux/unix env.

The inode entry does not affect the actual data in the file.  If the
length of the file has to be changed then the entire file has to be
processed irregardless of which operating system (AFAIK) you are running
this on.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to