If you are on linux, try command ->tail -13 FILE_NAME
--
Shekar
On Tue, Jun 12, 2012 at 11:38 AM, lina wrote:
> Hi,
>
> How to read the files last 13 lines,
>
> only process the data of the last 13 lines, ignore the head parts.
>
> Thanks with best regards,
>
> --
> To unsubscribe, e-mail:
How to read the files last 13 lines,
only process the data of the last 13 lines, ignore the head parts.
Thanks with best regards,
Try File::Tail, this is might what you are looking for:
use File::Tail;
my $file=File::Tail->new(name=>"file.txt", tail=>13);
while (defined(my $line=$file->re
Hi,
How to read the files last 13 lines,
only process the data of the last 13 lines, ignore the head parts.
Thanks with best regards,
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Hi GlenM,
Please my comments below:
On Mon, Jun 11, 2012 at 7:06 PM, GlenM wrote:
> Hello Folks;
>
> I see an earlier post about sluggish code - I am not really sure what I am
> doing, so I let me post my entire script here.
>
> ++
>
> #!/usr/bin/
Hi John,
Please, check my comments below:
On Sun, Jun 10, 2012 at 12:23 PM, John M Rathbun wrote:
> Hello and thanks for volunteering your time!
>
> I'm returning to PERL after about a year and am struggling to remaster
> some syntax:
>
> #!/usr/local/bin/perl
> use warnings;
> use strict;
> us
Hi John
Refer to the comments
foreach $i (@dir) {
*#$i here refers to each content of your array @dir, which are file names*
my @title = split /\./, $dir[$i];
*#$i here refers to the array index, which should be number*
$name = $title[0];
print FH "$name\n";
}
Zheng
2012/6/10 John M Rathbun
>
On Mon, Jun 11, 2012 at 9:36 PM, Ken Slater wrote:
> On Mon, Jun 11, 2012 at 2:06 PM, GlenM wrote:
>> Hello Folks;
>>
>> I see an earlier post about sluggish code - I am not really sure what I am
>> doing, so I let me post my entire script here.
>>
>>
On Mon, Jun 11, 2012 at 2:06 PM, GlenM wrote:
> Hello Folks;
>
> I see an earlier post about sluggish code - I am not really sure what I am
> doing, so I let me post my entire script here.
>
> ++
>
> #!/usr/bin/perl
>
> #use strict;
> use DBI;
> use
Hello Folks;
I see an earlier post about sluggish code - I am not really sure what I am
doing, so I let me post my entire script here.
++
#!/usr/bin/perl
#use strict;
use DBI;
use XML::XPath;
use XML::XPath::XMLParser;
# Set the input dir where
venkates wrote:
Hi all,
Hello,
I am trying to filter files from a directory (code provided below) by
comparing the contents of each file with a hash ref (a parsed id map
file provided as an argument). The code is working however, is extremely
slow. The .csv files (81 files) that I am reading
On 12-06-11 03:51 PM, Mark Haney wrote:
Here's a portion of the html:
M T
I thought that the values of each selected checkbox would be passed via
the variable name 'DoW' (as in 'MTWTH' or 'MWF'), but that doesn't look
like the case.
The data is passed to a CGI script that does this before pa
This might be the wrong place to post this, but since it's /sort of/
perl related, maybe I'll get some help.
I've got a series of checkboxes denoting the days of the week and I want
the ones that are checked to be passed to my CGI script from the form.
Apparently, I'm not getting the method wh
On Jun 11, 2012, at 7:31 AM, venkates wrote:
> Hi all,
>
> I am trying to filter files from a directory (code provided below) by
> comparing the contents of each file with a hash ref (a parsed id map file
> provided as an argument). The code is working however, is extremely slow.
> The .csv
It's hard to suggest improvement seeing only a fragment of entire code
for, but
I would probably expect your code to be slow as you have 5 nested for each
loops:
while ( my @data_files = grep(/\.csv$/,readdir(DH)) )
...
foreach my $file ( @data_files )
...
while ( my $data = <$FH>
On 12-06-11 11:04 AM, lina wrote:
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(open close);
use Carp qw(croak);
use 5.012;
my $tra=7;
my @files=("01".."40");
foreach(@files){
$tra=process_onefile("replica_index_$_.xvg");
}
sub process_onefile{
my $b
On Mon, Jun 11, 2012 at 10:42 PM, Brian Fraser wrote:
> On Mon, Jun 11, 2012 at 10:49 AM, lina wrote:
>>
>> Hi,
>>
>>
>> $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done
>> 01
>> 02
>> 03
>> 04
>> 05
>> 06
>> 07
>> 08
>> 09
>> 10
>>
>> I wonder how can I get something like above in the perl.
On Mon, Jun 11, 2012 at 4:31 PM, venkates wrote:
> Hi all,
>
> I am trying to filter files from a directory (code provided below) by
> comparing the contents of each file with a hash ref (a parsed id map file
> provided as an argument). The code is working however, is extremely slow.
> The .csv
On Mon, Jun 11, 2012 at 10:49 AM, lina wrote:
> Hi,
>
>
> $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done
> 01
> 02
> 03
> 04
> 05
> 06
> 07
> 08
> 09
> 10
>
> I wonder how can I get something like above in the perl.
>
>
for my $i ("01".."10") {
say $i;
}
Hi all,
I am trying to filter files from a directory (code provided below) by
comparing the contents of each file with a hash ref (a parsed id map
file provided as an argument). The code is working however, is extremely
slow. The .csv files (81 files) that I am reading are not very large
(l
Hi,
On Mon, 11 Jun 2012 07:10:07 -0700
"Ron Bergin" wrote:
> >lina wrote:
> > Hi,
> >
> >
> > $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done
> > 01
> > 02
> > 03
> > 04
> > 05
> > 06
> > 07
> > 08
> > 09
> > 10
> >
> > I wonder how can I get something like above in the perl.
> >
> perl -e
>lina wrote:
> Hi,
>
>
> $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done
> 01
> 02
> 03
> 04
> 05
> 06
> 07
> 08
> 09
> 10
>
> I wonder how can I get something like above in the perl.
>
perl -e "for (1..10){printf(qq(%02d\n), $_)}"
Ron
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.
How about:
use strict;
use warnings;
foreach my $i(1..10){$i="0" . $i if length($i)==1;print "$i\n";}
-Original Message-
From: lina [mailto:lina.lastn...@gmail.com]
Sent: Monday, June 11, 2012 8:49 AM
To: beginners@perl.org
Subject: how to get a sequence of 01 02 ..
Hi,
$ for i in `s
Hi,
$ for i in `seq -f '%02g' 1 10` ; do echo $i ; done
01
02
03
04
05
06
07
08
09
10
I wonder how can I get something like above in the perl.
Thanks ahead for your suggestions,
Best regards,
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginner
Hello and thanks for volunteering your time!
I'm returning to PERL after about a year and am struggling to remaster
some syntax:
#!/usr/local/bin/perl
use warnings;
use strict;
use diagnostics;
# Converts current directory to a list of links
my @dir;
my $name;
my $i = 0;
opendir DH, "." or
24 matches
Mail list logo