Hi All,
I try to search the string which has the date format inside
the file,
But i am not able to get the desired files. Pls help me on this..
C)/tmp/sms/perl$ cat a1
115-06-1979
10-11-81
20-NOV-2008
05-07-1981
welcome
15-10-2008
12-03-20009
(C)/tmp/sms/per
You missed some parentheses
#!/usr/bin/perl
use strict;
use warnings;
open(DATA, '<', "data") || die"Unable to open the file";
while() {
#if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/) {
if(/(\d{2}-(\d{2})|(\w{3})-\d{1,4})/) {
print;
}
}
close(DATA);
exit 0;
On S
Hi David,
Thanks for the reply, but still I am not able to get expected
output from this.
Pls help me how to get this.
(C)/tmp/d$ cat a1
115-06-1979
10-11-81
20-NOV-2008
05-07-1981
welcome
20-03-20009
15-10-2008
(C)/tmp/d$ cat 1
#/usr/bin/perl
use strict;
use
Hi all,
I work with ssm-server - server for bioinformatic purposes
(http://www.ebi.ac.uk/msd-srv/ssm/).
For each request it gives information of several html-pages.
Also there is a possibility save file in preferable format:
to click on "save"-button, click Yes on "Do you want to save"-window.
Wh
Hi all ,
Can someone help me on this
From: Sureshkumar M (HCL Financial Services)
Sent: Saturday, November 29, 2008 4:21 PM
To: 'David Schmidt'
Cc: beginners@perl.org
Subject: RE: date format search insdie the files
Hi David,
Thanks for t
Hi All,
Can someone send the maid's for Perl forum where I can clear
all my doubts? I would like to discuss lot of doubts and get answer and
get quick answers.
Regards,
Suresh
"Sureshkumar M (HCL Financial Services)" schreef:
> #/usr/bin/perl
> open(DATA,"a1")||die"Unable to open the file";
> while()
> {
> if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/)
> {
> print $_;
> }
> }
> close(DATA);
> exit 0;
#!/usr/bin/perl
use strict;
use warnings;
my $in_name = "data.in";
Thanks a lot for your help,,
Can you explain me this part how it's works?
(?:\d{2}|\w{3})
?: what this will do?
And also, the output is like below
(C)/tmp/d$ perl 1
10-11-81
20-NOV-2008
05-07-1981
15-110-2008 this should not come as this as 3 digit month.
(C)/tmp/d$
Program:
(
"Sureshkumar M (HCL Financial Services)" schreef:
> Can you explain me this part how it's works?
>
> (?:\d{2}|\w{3})
>
> ?: what this will do?
Read perlre (and find out what (?:) means).
> And also, the output is like below
>
>
> (C)/tmp/d$ perl 1
> 10-11-81
> 20-NOV-2008
> 05-07-1981
>
"Sureshkumar M (HCL Financial Services)" schreef:
> Can someone help me on this
Impossible.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hello all, what am i missing!!!
#!/usr/bin/perl -w
@array_number =;
@new_array = half( @array_number );
print "@new_array\n";
sub half {
@numbers = @_;
while (<@numbers>){
@n = $_ / 2;
@new_a = pop(@n);
}
return @new_a;
}
#I am calling a sub function "half".
#but it r
On Fri, 2008-11-28 at 11:56 -0800, slow_leaner wrote:
> Hello all, what am i missing!!!
> #!/usr/bin/perl -w
> @array_number =;
> @new_array = half( @array_number );
> print "@new_array\n";
>
> sub half {
> @numbers = @_;
> while (<@numbers>){
> @n = $_ / 2;
> @new_a = pop(@n)
> Message du 29/11/08 12:55
> De : "Sureshkumar M (HCL Financial Services)"
> A : beginners@perl.org, [EMAIL PROTECTED]
> Copie à :
> Objet : Mailing list
>
> Hi All,
>
>
>
> Can someone send the maid's for Perl forum where I can clear
> all my doubts? I would like to discuss lot of dou
Hi again,
Is it possible to modify the following script to return a list of
available fields? I'm trying to query my address at fastmail.fm and
would like to display as much info as possible.
Thanks in advance,
festus
--
I just want to break even.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
OK - let's try the script this time!
http://bsdconsulting.no/tools/mutt-ldap.pl
On Sat, Nov 29, 2008 at 09:32:32AM -0700, John J. Foster wrote:
> Hi again,
>
> Is it possible to modify the following script to return a list of
> available fields? I'm trying to query my address at fastmail.fm and
On Sat, Nov 29, 2008 at 11:32, John J. Foster
<[EMAIL PROTECTED]> wrote:
> Hi again,
>
> Is it possible to modify the following script to return a list of
> available fields? I'm trying to query my address at fastmail.fm and
> would like to display as much info as possible.
snip
Replace
i
slow_leaner wrote:
Hello all,
Hello,
what am i missing!!!
#!/usr/bin/perl -w
@array_number =;
@new_array = half( @array_number );
print "@new_array\n";
sub half {
@numbers = @_;
while (<@numbers>){
That is short for:
while ( defined( $_ = glob join $", @numbers ) ) {
Hi,
My problem is to match HTML tags with RegExp. I managed to match something like
this, properly:
la la la a paragraph bla bla bla another paragraph ya ya ya
But when nested, there arises problems:
a paragraph bla bla bla la la la
It matches
A paragraph bla bla bla
instead of matching the
On Sat, Nov 29, 2008 at 20:02, Canol Gökel <[EMAIL PROTECTED]> wrote:
> Hi,
>
> My problem is to match HTML tags with RegExp.
snip
Can't be done*. You need a parser.
snip
> Note: Most probably there is a module for this but:
> - I want to learn the logic,
snip
Learn to write a parser instead.
Chas. Owens gmail.com> writes:
>
> On Sat, Nov 29, 2008 at 20:02, Canol Gökel canol.info> wrote:
> Can't be done*. You need a parser.
snip
It can be done.
snip
> Learn to write a parser instead. This is like asking how to build a
> bridge for people out of toothpicks. It can be done (bu
On Sat, Nov 29, 2008 at 20:50, Canol Gökel <[EMAIL PROTECTED]> wrote:
> Chas. Owens gmail.com> writes:
>
>>
>> On Sat, Nov 29, 2008 at 20:02, Canol Gökel canol.info> wrote:
>
>> Can't be done*. You need a parser.
>
> snip
>
> It can be done.
snip
Note that asterisk.
snip
>> Learn to write a pa
I am trying to get 081129 into $dayStamp.
#!/usr/bin/perl -w
use strict;
my $dayStamp;
$dayStamp = `date +\'%y%m%d\'` && die "Failure!";
print "$dayStamp\n";
My program outputs:
Failure! at /Users/dave/perl/dateLogger01.pl line 4.
I thought I did every conceivable combination of backticks and
On Sat, Nov 29, 2008 at 21:25, David <[EMAIL PROTECTED]> wrote:
> I am trying to get 081129 into $dayStamp.
>
> #!/usr/bin/perl -w
> use strict;
> my $dayStamp;
> $dayStamp = `date +\'%y%m%d\'` && die "Failure!";
> print "$dayStamp\n";
>
>
> My program outputs:
> Failure! at /Users/dave/perl/dateLo
David wrote:
I am trying to get 081129 into $dayStamp.
#!/usr/bin/perl -w
use strict;
my $dayStamp;
$dayStamp = `date +\'%y%m%d\'` && die "Failure!";
You have three problems with that statement:
1) The '=' operator has higher precedence than the '&&' operator so you
need to either enclose
i have a c program that I want to just run from perl and capture output
I would have thought
my $c_output = `/tmp/c_program`;
would get me the output of the program.
instead it prints out to the screen.
Is there way to redirect STOUT just for that line and put it back to normal?
--
To unsubs
On Sun, Nov 30, 2008 at 00:52, Richard <[EMAIL PROTECTED]> wrote:
> i have a c program that I want to just run from perl and capture output
>
> I would have thought
>
> my $c_output = `/tmp/c_program`;
>
> would get me the output of the program.
>
> instead it prints out to the screen.
>
> Is there
> Message du 30/11/08 06:52
> De : "Richard"
> A : beginners@perl.org
> Copie à :
> Objet : capturing output from c program inside of perl
>
>
> i have a c program that I want to just run from perl and capture output
>
> I would have thought
>
> my $c_output = `/tmp/c_program`;
>
I was not sure w
Chas. Owens wrote:
On Sun, Nov 30, 2008 at 00:52, Richard <[EMAIL PROTECTED]> wrote:
i have a c program that I want to just run from perl and capture output
I would have thought
my $c_output = `/tmp/c_program`;
would get me the output of the program.
instead it prints out to the screen.
28 matches
Mail list logo