On 4/27/06, sandy <[EMAIL PROTECTED]> wrote:
> Hi,
>
>
> The content of file hello.c is as given below.
> I want to count how many + and - are there in this file.
> I had equivalent shel command to count no. of + and -,
>
> grep -e "^+[^+]" diffs.txt | wc -l
> grep -e "^-[^-]" diffs.txt | wc -l
>
--
Hi,
The content of file hello.c is as given below.
I want to count how many + and - are there in this file.
I had equivalent shel command to count no. of + and -,
grep -e "^+[^+]" diffs.txt | wc -l
grep -e "^-[^-]" diffs.txt | wc -l
Can anyone help me how to write perl script using
On 6/28/05, Jay Savage <[EMAIL PROTECTED]> wrote:
> On 6/28/05, Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote:
> > On Jun 28, [EMAIL PROTECTED] said:
> >
> > > but here is another piece of code I tried and this worked as well
> > > considering the attachment:
> > >
> > > comments on the below block
On 6/28/05, Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote:
> On Jun 28, [EMAIL PROTECTED] said:
>
> > but here is another piece of code I tried and this worked as well
> > considering the attachment:
> >
> > comments on the below block?
> [snip]
> > if (m/begin pgp public key block/ig) {
> > $lc
On Jun 28, [EMAIL PROTECTED] said:
but here is another piece of code I tried and this worked as well
considering the attachment:
comments on the below block?
[snip]
if (m/begin pgp public key block/ig) {
$lc=1;
}
if ( $lc==1){
print $_;
}
if (m/end pgp public key block/ig) {
$lc=0;
}
On 6/28/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Actually,
>
> you are incorrect... The +>> mean read and write in append mode. Please
> see the follow up email with the attachment I sent.
>
> Derek B. Smith
> OhioHealth IT
> UNIX / TSM / EDM Teams
> 614-566-4145
While you are correct
On Jun 28, [EMAIL PROTECTED] said:
for (;;) {
if (/^-{5,}(\w+)/ig) {
print $_;
}
$lc++;
}
I want to print everything from BEGIN TO END and right now all I am
printing is the begin and end lines.
If that's what you want, you should use two regexes with the .. operator:
while ()
On 6/28/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Can anyone help me with this match:
[snip]
> for (;;)
> {
> if (/^-{5,}(\w+)/ig) {
> print $_;
>
> }
>
Subject
Please respond to Re: reg exp help
bright true
<[EMAIL PROTECTED]
Hello,
First of all you're opening the file for writing
Second i didn't understand what you really want , if you want to print out
everything inside the file
my $file = 'newfile.txt';
open(FILE,$file);
while(){
print $_;}
close(FILE);
That's it with out matching or anything
bye
On 6/2
Can anyone help me with this match:
#!/usr/bin/perl
use strict;
use warnings;
my $talxkeylog =qq(/home/gpghrp/.gnupg/keys/log/talxkeyupd.log);
open (FH, "+>>$talxkeylog") or warn "unable to open file
$talxkeylog $!"
;
#&cURL();
#print "$calcdate\n$curtdate";
my (
Hi
If "Request timed out" occurs in the output from PING command you can be
quite sure that the request timed out. :-)
Therefore it's be bit to much hazzle to check for embedded newlines
(using the \m modifier), one could just say:
if ($machine_status =~ /Request timed out\./) {
Remember to es
Trina Espinoza wrote:
Var $machine_status contains this block of data:
machine_status = "Pinging 129.111.3.79 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.111.3.79:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)
Var $machine_status contains this block of data:
machine_status = "Pinging 129.111.3.79 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.111.3.79:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Approximate round tr
OTECTED]>
> Sent: Wednesday, July 23, 2003 1:21 AM
> Subject: RE: Reg Exp Help...
>
>
> >
> >
> > On 22 Jul 2003 09:15:29 -0700, James Kelty <[EMAIL PROTECTED]> wrote:
> >
> > > I know that this is
James Kelty wrote:
>
> I know that this is a common request, but I have a question about
> parsing an email box. I have a UW IMAP box, and I am trying to extract
> all the emails where the line starts with From: blah blah. Now, getting
> those lines isn't the issue, but since each email is a littl
- Original Message -
From: <[EMAIL PROTECTED]>
To: "James Kelty" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 1:21 AM
Subject: RE: Reg Exp Help...
>
>
> On 22 Jul 200
On 22 Jul 2003 09:15:29 -0700, James Kelty <[EMAIL PROTECTED]> wrote:
> I know that this is a common request, but I have a question about
> parsing an email box. I have a UW IMAP box, and I am trying to extract
> all the emails where the line start
I know that this is a common request, but I have a question about
parsing an email box. I have a UW IMAP box, and I am trying to extract
all the emails where the line starts with From: blah blah. Now, getting
those lines isn't the issue, but since each email is a little different,
I am having a pro
From: "David Samuelsson (PAC)" <[EMAIL PROTECTED]>
> i got this line in an array allready, if i do a print off the array it
> prints this line.
>
> Last accessed 08-mar-02.10:27:55 by fdefgre.Domain
> [EMAIL PROTECTED]
>
> what i want to do now is only pick out the date that is the
> "08-mar-0
Hi,
This should work.
$_ = $your_string_array;
$_ =~ /accessed (.*?)\./;
$date = $1;
print $date;
Regards,
Mikael Larsson
-Ursprungligt meddelande-
Från: David Samuelsson (PAC) [mailto:[EMAIL PROTECTED]]
Skickat: den 26 mars 2002 11:53
Till: '[EMAIL PROTECTED]'
Ämne: re
i got this line in an array allready, if i do a print off the array it prints this
line.
Last accessed 08-mar-02.10:27:55 by fdefgre.Domain [EMAIL PROTECTED]
what i want to do now is only pick out the date that is the "08-mar-02"
As it says in the manuals, one of the best with things with per
Thanks Daryl & 'Japhy' for your suggestions. I ended up using:
$Out = `$Cmd` ;
$Out =~ /^\|GRP\|\s*(.*)/m ;
The data I want ends up in $1.
-Original Message-
From: Busse, Rich
Sent: Tuesday, 26 February, 2002 09:35
To: Perl Beginners
Subject: Reg E
On Feb 26, Daryl J. Hoyt said:
>If there is only one of the lines |GRP| this will work. Otherwise I would
>push the lines into a an array instead of a variable.
>
>@Out = `$Cmd`;
>$WhatFollowsGRP = "";
>
>foreach my $line (@Out)
>{
> if($line =~ /|GRP|/)
You need to escape those |'s. They
On Feb 26, Busse, Rich said:
> $Out = `$Cmd` ;
>
>The output always looks like:
>
>List of Templates and Template Groups assigned to 'somenode.us.dnb.com':
>
>|GRP| SBS-DSM
>=
2002 8:35 AM
To: Perl Beginners
Subject: Reg Exp help
I am capturing the output of a command in a string:
$Out = `$Cmd` ;
The output always looks like:
List of Templates and Template Groups assigned to 'somenode.us.dnb.com':
==
I am capturing the output of a command in a string:
$Out = `$Cmd` ;
The output always looks like:
List of Templates and Template Groups assigned to 'somenode.us.dnb.com':
|GRP| SBS-DSM
=
On Feb 8, Stuart Clark said:
>if ($Charge > 0 && (($VisaCard|$BankCard),$CreditCard) ) { # This bit
>doesn't work?
What is ((A | B), C) trying to do? Perhaps you want:
(($VisaCard || $BankCard) && $CreditCard)
>}elsif ($CreditCard = "" && $Charge < 0 ) { # Is "" ok for a null entry?
You ne
28 matches
Mail list logo