--
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 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
You say two
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
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(FILE){
print $_;}
close(FILE);
That's it with out matching or anything
bye
respond to Re: reg exp help
bright true
[EMAIL PROTECTED]
.com
On 6/28/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Can anyone help me with this match:
[snip]
for (;FH;)
{
if (/^-{5,}(\w+)/ig) {
print $_;
}
On Jun 28, [EMAIL PROTECTED] said:
for (;FH;) {
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:
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, please
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, 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=1;
}
if (
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?
[snip]
if
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
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
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%
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
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 starts
- 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 2003 09:15:29 -0700, James Kelty [EMAIL PROTECTED] wrote
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 little
On Wed, 23 Jul 2003 02:41:28 +0800, LI NGOK LAM [EMAIL PROTECTED] wrote:
- Original Message -
From: [EMAIL PROTECTED]
To: James Kelty [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 1:21 AM
Subject: RE: Reg Exp
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: reg exp help
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-02
As it
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
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
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':
|GRP| SBS-DSM
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
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
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 need to use eq
27 matches
Mail list logo