Re: Deletion of lines in file using perl

2008-04-23 Thread Chas. Owens
On Wed, Apr 23, 2008 at 8:56 AM, <[EMAIL PROTECTED]> wrote: > Hi All, > > I need to delete some lines in file using Perl. The requirement is that > I have one file which contains following lines. > > Element * checkdout > Element * latest. snip You should read http://perldoc.perl.org/perlfaq5

Re: Deletion of lines in file using perl

2008-04-23 Thread J. Peng
On Wed, Apr 23, 2008 at 8:56 PM, <[EMAIL PROTECTED]> wrote: > Hi All, > > > > I need to delete some lines in file using Perl. The requirement is that > I have one file which contains following lines. > Please submit your question to "[EMAIL PROTECTED]". -- J. Peng - QQMail Operation Team eM

Deletion of lines in file using perl

2008-04-23 Thread Irfan.Sayed
Hi All, I need to delete some lines in file using Perl. The requirement is that I have one file which contains following lines. Element * checkdout Element * latest. And now I want to delete these lines using Perl script. Please help. Regards, Irfan

Re: # of lines in file

2001-07-16 Thread Jeff 'japhy' Pinyan
On Jul 16, Martijn van Exel said: >I'm trying to get a line count for a number of files. Is sysread() the >preferred (fastest, most efficient) way to go (snippet 1) or should I >read the file into an array and count the array instead (something like >snippet 2, untested)? Do NOT read a file

Re: # of lines in file

2001-07-16 Thread Jos I. Boumans
Don't do the "put a file into an array" trick if you're not VERY sure the file is small. It's generally concidered bad programming practice and a recipe for disaster if you dont control the input. having said that, i'd like to note that there's also a memory penalty for using an array over a stri

Re: # of lines in file

2001-07-16 Thread Ondrej Par
As sysread() doesn't use buffers, it's probably more efficient to use normal reads. Also, splitting lines by yourself (i.e. in Perl) won't be as efficient as in C implementation. Thus I recommend to use open(FILEH, "database/$_") or die "$!"; my @tempfile = ; close FILEH; my $lines = scalar @te

RE: # of lines in file

2001-07-16 Thread Kipp, James
; } > -Original Message- > From: Martijn van Exel [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 16, 2001 8:55 AM > To: [EMAIL PROTECTED] > Subject: # of lines in file > > > Subscribers, > > I'm trying to get a line count for a number of files. Is >

# of lines in file

2001-07-16 Thread Martijn van Exel
Subscribers, I'm trying to get a line count for a number of files. Is sysread() the preferred (fastest, most efficient) way to go (snippet 1) or should I read the file into an array and count the array instead (something like snippet 2, untested)? Thanks for your insights. $_ contains the f