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
>
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
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)
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
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
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 Exp help
I am capturi
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
>=
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|/)
{
$line =~ s/|GRP|//;
$WhatFollowsGR
20 matches
Mail list logo