Re: reg exp help

2006-04-27 Thread Jay Savage
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 >

reg exp help

2006-04-27 Thread sandy
-- 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

Re: reg exp help

2005-06-28 Thread Jay Savage
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

Re: reg exp help

2005-06-28 Thread Jay Savage
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

Re: reg exp help

2005-06-28 Thread Jeff 'japhy' Pinyan
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; }

Re: reg exp help

2005-06-28 Thread Jay Savage
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

Re: reg exp help

2005-06-28 Thread Jeff 'japhy' Pinyan
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 ()

Re: reg exp help

2005-06-28 Thread Jay Savage
On 6/28/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can anyone help me with this match: [snip] > for (;;) > { > if (/^-{5,}(\w+)/ig) { > print $_; > > } >

Re: reg exp help

2005-06-28 Thread DBSMITH
Subject Please respond to Re: reg exp help bright true <[EMAIL PROTECTED]

Re: reg exp help

2005-06-28 Thread bright true
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

reg exp help

2005-06-28 Thread DBSMITH
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 (

Re: Reg Exp Help

2005-03-10 Thread Gretar M Hreggvidsson
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

Re: Reg Exp Help

2005-03-09 Thread John W. Krahn
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)

Reg Exp Help

2005-03-09 Thread Trina Espinoza
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

Re: Reg Exp Help...

2003-07-22 Thread wiggins
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

Re: Reg Exp Help...

2003-07-22 Thread John W. Krahn
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

Re: Reg Exp Help...

2003-07-22 Thread LI NGOK LAM
- 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

RE: Reg Exp Help...

2003-07-22 Thread wiggins
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

Reg Exp Help...

2003-07-22 Thread James Kelty
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

Re: reg exp help!

2002-03-26 Thread Jenda Krynicky
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

SV: reg exp help!

2002-03-26 Thread Larsson Mikael (MLAH)
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

reg exp help!

2002-03-26 Thread David Samuelsson (PAC)
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

RE: Reg Exp help

2002-02-27 Thread Busse, Rich
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

RE: Reg Exp help

2002-02-26 Thread Jeff 'japhy' Pinyan
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

Re: Reg Exp help

2002-02-26 Thread Jeff 'japhy' Pinyan
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 >=

RE: Reg Exp help

2002-02-26 Thread Daryl J. Hoyt
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': ==

Reg Exp help

2002-02-26 Thread Busse, Rich
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 =

Re: more reg exp help please

2002-02-07 Thread Jeff 'japhy' Pinyan
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