On 2012-12-28 21:32, twle...@reagan.com wrote:
I hope this is a simple fix. I want to check the beginning characters of items in a
hash, and compare that to a scalar variable. I do not need for the entire value to
match; just the first couple of characters. Here is a simple example of what I
"timothy adigun" wrote in message
news:CAEWzkh6mZohVJn__LRL60AGoqbHkmTPyn=JM=cewcmmftpj...@mail.gmail.com...
Hello Chris,
Please see my comment below.
On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley
wrote:
[snip]
I only answered the question using a for loop. Am not the one who
origi
Thank you Chris. Using strict and warnings should have been the first thing
that I did. Thank you also for the code correction.
-Original Message-
From: Chris Charley [mailto:char...@pulsenet.com]
Sent: Friday, December 28, 2012 5:52 PM
To: beginners@perl.org
Subject: Re: Pattern
@perl.org
Subject: Re: Pattern matching to hash
Hi,
my $prefix_search_list = '03S,04S';
my @prefix_array = split /\,/,$prefix_search_list;
my %prefix_hash = map {$_ => 1 } @prefix_array;
#compare 05S to 03S and 04S
my $input_field = "05S885858"; #should not match
Chris Charley"" wrote in message news
Tim wrote in message news:1356726727.215915...@webmail.reagan.com...
I hope this is a simple fix. I want to check the beginning characters of
items in a hash, and compare that to a scalar variable.
I do not need for the entire value to match; just the
Hello Chris,
Please see my comment below.
On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley wrote:
>
>
> Tim wrote in message news:1356726727.215915216@**webmail.reagan.com...
>
> I hope this is a simple fix. I want to check the beginning characters of
>> items in a hash, and compare that to a s
Tim wrote in message news:1356726727.215915...@webmail.reagan.com...
I hope this is a simple fix. I want to check the beginning characters of
items in a hash, and compare that to a scalar variable.
I do not need for the entire value to match; just the first couple of
characters.
Tim
my $p
Hi,
> my $prefix_search_list = '03S,04S';
> my @prefix_array = split /\,/,$prefix_search_list;
> my %prefix_hash = map {$_ => 1 } @prefix_array;
>
> #compare 05S to 03S and 04S
> my $input_field = "05S885858"; #should not match
>
1. using stricts and warnings pragma, shows clearly that there i
I hope this is a simple fix. I want to check the beginning characters of items
in a hash, and compare that to a scalar variable. I do not need for the entire
value to match; just the first couple of characters. Here is a simple example
of what I want, but it does not work. Both "if" statemen
On 08/03/2012 17:03, sunita.prad...@emc.com wrote:
Hi All
I have one output of one my command like :
$output = "Step 155 of 171 steps.Executing.
Step 168 of 171 steps.Executing.
Step 171 of 171 steps..
On Thu, Mar 8, 2012 at 11:03 AM, wrote:
> Hi All
>
> I have one output of one my command like :
>
> $output = "Step 155 of 171
> steps.Executing.
> Step 168 of 171 steps.Executing.
> Step 171 of 171 steps..
Hi All
I have one output of one my command like :
$output = "Step 155 of 171 steps.Executing.
Step 168 of 171 steps.Executing.
Step 171 of 171 steps.Executing.
Local: COMMIT...
On 11-09-27 05:30 PM, Chris Stinemetz wrote:
Trying to match the what is contained in $what 3 consecutive times.
But I am getting the followoing error:
Use of uninitialized value $_ in pattern match (m//) at ./ex9-1.pl line 7.
The program:
#!/usr/bin/perl
use warnings;
use strict;
my $what
Trying to match the what is contained in $what 3 consecutive times.
But I am getting the followoing error:
Use of uninitialized value $_ in pattern match (m//) at ./ex9-1.pl line 7.
The program:
#!/usr/bin/perl
use warnings;
use strict;
my $what = 'fred|barney';
if (/($what){3}/) {
print $wha
At 2:16 PM -0500 11/14/10, shawn wilson wrote:
so, if you've got a file, do something like:
while ($line = ) {
$line =~ m/^(.+)$/ig;
print "$1<\/s>\n";
}
If all you want to do is print each line in the file surrounded by
tags, you don't need regular expressions, and you don't need to
esca
On 14/11/2010 19:04, Zachary Brooks wrote:
What happened when I used the code --
$hello =~ s/^(.+)$/\1<\/s>/gis;
-- is that is properly marked and the beginning of the sentence and
at the end of the sentence, but then it only worked for one sentence.
Any suggestions on getting to appear at t
so, if you've got a file, do something like:
while ($line = ) {
$line =~ m/^(.+)$/ig;
print "$1<\/s>\n";
}
On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman wrote:
> > "sw" == shawn wilson writes:
>
> sw> second, why not use a place holder like someone recommended yesterday?
> sw> somethin
On 14/11/2010 13:53, Zachary Brooks wrote:
Hey Rob,
Of all the feedback. yours was the one I was able to drop into my code
and make it work, no matter how rudimentary my understanding of Perl is.
Thanks.
You're welcome. I'm glad to be able to help.
As far as the XML libraries, we are suppose
What happened when I used the code --
$hello =~ s/^(.+)$/\1<\/s>/gis;
-- is that is properly marked and the beginning of the sentence and
at the end of the sentence, but then it only worked for one sentence.
Any suggestions on getting to appear at the beginning of every sentence
and to appea
On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman wrote:
> > "sw" == shawn wilson writes:
>
> sw> second, why not use a place holder like someone recommended yesterday?
> sw> something like:
> sw> s/^(.+)$/\1<\/s>/g
>
> what is a placeholder? nothing like that in regexes. what you have there
>
> "sw" == shawn wilson writes:
sw> second, why not use a place holder like someone recommended yesterday?
sw> something like:
sw> s/^(.+)$/\1<\/s>/g
what is a placeholder? nothing like that in regexes. what you have there
is a backreference and used in the wrong place. \1 is meant to b
On 10-11-14 11:42 AM, Zachary Brooks wrote:
$hello = "This is some sample text.";
$hello =~ s/^..//gi;
$hello =~ s/..$/<\/s>/gi;
print "$hello\n";
*is is some sample tex*
The meta-character '.' matches every character except a newline. The
first substitution replaces 'Th' with ''. The sec
On Sun, Nov 14, 2010 at 11:42 AM, Zachary Brooks
wrote:
> Hello again,
>
> Yesterday I had a question on pattern matching. A couple of people
> responded
> with very useful information. After some finagling, I got my rudimentary
> code to work. I'm a PhD student studying co
Hello again,
Yesterday I had a question on pattern matching. A couple of people responded
with very useful information. After some finagling, I got my rudimentary
code to work. I'm a PhD student studying computational linguistics without
any formal programming training. While there are va
On 13/11/2010 18:42, Zachary Brooks wrote:
Hello,
I'm taking a PhD course that requires the use of Perl and pattern matching.
I've taken on the motto "divide and conquer," but it hasn't quite worked. I
appreciate anyone's help.
The task is to extract sentences fro
I've had similar issues and the \Q \E flags didn't fix it.
One thing I've done to fix an issue where regex metacharacters are being
caught is to do a replace on all of the characters to include a \ right in
front.
Something like this:
open (my $FILE, "<", $file) or die "$!\n";
my @lines = <$FILE
On 10-11-13 01:42 PM, Zachary Brooks wrote:
1. My first approach was to use substitute to get rid of a range of things
between and. A short version looks like this.
$hello = " man at the bar order the";
$hello =~ s/.*<\/DATELINE>//gi;
print "$hello\n";
I was about to say that you should use
Hello,
I'm taking a PhD course that requires the use of Perl and pattern matching.
I've taken on the motto "divide and conquer," but it hasn't quite worked. I
appreciate anyone's help.
The task is to extract sentences from a relatively large text file (928K,
ca.
Thanks guys, I could able to understand split fun.
--- On Mon, 19/7/10, John W. Krahn wrote:
From: John W. Krahn
Subject: Re: usage of Split on pattern matching
To: "Perl Beginners"
Date: Monday, 19 July, 2010, 4:29 PM
Chandan Kumar wrote:
> Hi all,
Hello,
> Iam beginner
Chandan Kumar wrote:
Hi all,
Hello,
Iam beginner to perl& i have a small query on split.
using split i want print everything even the character used to split on string.
Here is my example :
my $string = "hi123now456itstimeforsplit789right"
my @array = split ( '/(\d+\s)/ ',$string);
## Try
On Mon, Jul 19, 2010 at 08:14, Chandan Kumar wrote:
snip
> my $string = "hi123now456itstimeforsplit789right"
> my @array = split ( '/(\d+\s)/ ',$string);
snip
> When I run the program ,it prints the whole string. so my assumption is wrong.
>
> please Could some one explain me on this?
snip
The s
Hi all,
Iam beginner to perl & i have a small query on split.
using split i want print everything even the character used to split on string.
Here is my example :
my $string = "hi123now456itstimeforsplit789right"
my @array = split ( '/(\d+\s)/ ',$string);
## Trying to split using digitnumbe
Owen Chavez wrote:
Hello!
I have a pattern matching question using Perl 5.10, Windows 7. Suppose I
have a file containing the following block of text:
Hello there TODD
I my We Us ourselves OUr I.
The file has 10 words, including 7 first-person pronouns (and 3 non-pronouns
that I have no
On Mon, 12 Apr 2010 23:04:53 -0500, Owen Chavez wrote:
> Can you suggest a reference on hashes that will provide some clue as to
> how they can be used for the problem I posted? I've looked over
> Programming Perl (3rd) and it's not entirely clear to me how to proceed
> with a hash.
Learning Perl
mming
Perl (3rd) and it's not entirely clear to me how to proceed with a hash.
Owen
On Mon, Apr 12, 2010 at 10:11 PM, Peter Scott wrote:
> On Mon, 12 Apr 2010 21:06:58 -0500, Owen Chavez wrote:
> > I have a pattern matching question using Perl 5.10, Windows 7. Suppose
> >
On Mon, 12 Apr 2010 21:06:58 -0500, Owen Chavez wrote:
> I have a pattern matching question using Perl 5.10, Windows 7. Suppose
> I have a file containing the following block of text:
>
> Hello there TODD
> I my We Us ourselves OUr I.
>
> The file has 10 words, including 7
Hello!
I have a pattern matching question using Perl 5.10, Windows 7. Suppose I
have a file containing the following block of text:
Hello there TODD
I my We Us ourselves OUr I.
The file has 10 words, including 7 first-person pronouns (and 3 non-pronouns
that I have no interest in).
I
Firstly, apologies for the double posting of this question.
On Wed, 01 Apr 2009 09:49 +0200, "Thomas Bätzler"
wrote:
> How about (untested):
>
> sub display_board {
> foreach my $ref (@_){
> foreach my $piece ( @$ref ){
> print substr( $piece, -2);
> }
> }
> }
>
> The Perl wa
Richard Hobson wrote:
> Please be patient with this beginner. I have a subrouting as follows,
> that prints out an ASCII representation of chess board
>
> sub display_board {
> foreach (0..7) {
> my $ref = @_[$_];
> foreach (0..7) {
> my $pi
Hi,
Please be patient with this beginner. I have a subrouting as follows,
that prints out an ASCII representation of chess board
sub display_board {
foreach (0..7) {
my $ref = @_[$_];
foreach (0..7) {
my $piece = $ref->[$_];
Richard Hobson wrote:
Hi,
Hello,
Please be patient with this beginner. I have a subrouting as follows,
that prints out an ASCII representation of chess board
sub display_board {
foreach (0..7) {
my $ref = @_[$_];
That should be:
my $ref = $_[$_];
Or better:
f
On Tue Mar 31 2009 @ 3:32, Richard Hobson wrote:
> It works, but is there a way of combining these lines:
>
> my $piece = $ref->[$_];
> $piece =~ /.*(..$)/;
>
> It feels like this could be done in one step. Is this correct? I'm
> finding that I'm d
Hi,
Please be patient with this beginner. I have a subrouting as follows,
that prints out an ASCII representation of chess board
sub display_board {
foreach (0..7) {
my $ref = @_[$_];
foreach (0..7) {
my $piece = $ref->[$_];
On Tue, 2008-09-23 at 14:05 -0700, Darren Nay wrote:
> Here is the string:
> doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";
> doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
>
> Now, I want to match against that string and retrieve the value of
> doctype-sys
Hey All,
I hope that you can help me. I have been struggling with this issue the past
couple of hours and can't seem to get it to work.
I am trying to get a value through pattern matching.
Here is the string:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";
doctype-publ
hi all,
the "column" is in a text file. fyi, david's pattern matching expression
(/^[ATGC]+$/i) did the job perfectly.
thanks all for you feedback!
anjan
On Tue, Sep 23, 2008 at 5:07 AM, sanket vaidya <[EMAIL PROTECTED]>wrote:
>
>
>
> Hi Anjan,
>Not a
age-
From: ANJAN PURKAYASTHA [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 23, 2008 6:52 AM
To: beginners@perl.org
Subject: pattern matching question
here is my problem:
i have to check the entries of a column and write them out to a file if they
happen to be DNA sequences ie they are exclus
mn also happens to have other strings that are made of
> word/digit/space characters.
> i tried
> if($x=~ /[ATGC]/ )then .
> however this pattern matching expression is unable to filter out the non-DNA
> sequences.
> i have also tried other expressions too convoluted to writ
-
From: ANJAN PURKAYASTHA [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 23, 2008 6:52 AM
To: beginners@perl.org
Subject: pattern matching question
here is my problem:
i have to check the entries of a column and write them out to a file if they
happen to be DNA sequences ie they are exclusivel
-Original Message-
From: ANJAN PURKAYASTHA [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 23 September 2008 11:22 AM
To: beginners@perl.org
Subject: pattern matching question
here is my problem:
i have to check the entries of a column and write them out to a file if they
happen to be DNA
tried
if($x=~ /[ATGC]/ )then .
however this pattern matching expression is unable to filter out the non-DNA
sequences.
i have also tried other expressions too convoluted to write out here.
any ideas?
tia,
anjan
--
=
anjan purkayastha, phd
bioinformatics analyst
Anirban Adhikary wrote:
Subject: Pattern matching problem
As far as I can tell, this is not a pattern matching problem.
I have a very large file basically it is logfile generated by sql
loader. In the production environment this file can have one
million/ two million data. In this
Dear List
I have a very large file basically it is logfile generated by sql
loader. In the production environment this file can have one
million/ two million data. In this file there are 4 particular lines which
i need to extract from this log file.
*Total logical records skipped:
Jin Zhisong wrote:
The following code didn't work.
My $type = $ARGV[1]
my $match = ( $type eq 'bcv' ) ? 'BCV' : 'RAID-5' ;
my $pattern = ( $type eq 'bcv' ) ? "${match}\s+N\/Asst" :
"${match}\s+N\/Grp" ;
while ( )
On 12/19/07, Jin Zhisong <[EMAIL PROTECTED]> wrote:
> The following code didn't work.
> my $pattern = ( $type eq 'bcv' ) ? "${match}\s+N\/Asst" :
> "${match}\s+N\/Grp" ;
Did it not work because it did not use qr//? That's at least part of
the problem. It may help you during development if yo
Thanks every one that helps. I find my problem. Now how
can I have a $pattern that contain some special characters
to pass it into regex?
I want to extract the line that contains either
RAID-5N/Grp'd
Or
BCV N/Asst'd
The following code didn't wor
"Jin Zhisong" schreef:
> I define a $match variable and use it in the patterr below.
> However it didn't match anything for the sample data.
perldoc -f qr
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
h
On 12/19/07, Jin Zhisong <[EMAIL PROTECTED]> wrote:
>next unless /\s+BCV\s+N/Grp/; it works
Oh, I hope it doesn't work. The number of forward slashes is all wrong.
> next unless /\s+BCV\s+N\/Grp/; it didn't work
But this one might actually parse. If it doesn't match when it's
supposed
Jin Zhisong wrote:
> HI, I'm looking for some advice of how to do this?
>
>
>
> I need to match some "variable" pattenrs so
>
>
>
> I define a $match variable and use it in the patterr below.
>
> However it didn't match anything for the sample data.
>
>
>
> If I change the match critia to h
HI, I'm looking for some advice of how to do this?
I need to match some "variable" pattenrs so
I define a $match variable and use it in the patterr below.
However it didn't match anything for the sample data.
If I change the match critia to hardcode
next unless /\s+BCV\s+N/Grp/;
On 8/29/07, Jim <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I hope this is simple, as i am very new to perl.
>
> I am trying to use pattern matchinig to create many srcipts from
> a template file which i have read into a list then print out to files.
>
> the problem is the patter match only matches on the
Hi,
I hope this is simple, as i am very new to perl.
I am trying to use pattern matchinig to create many srcipts from
a template file which i have read into a list then print out to files.
the problem is the patter match only matches on the first 2 successful matches
after that it keeps the valu
On 8/28/07, Chas Owens <[EMAIL PROTECTED]> wrote:
>
> On 8/28/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
> > When i write the condition
> > my @m = $fullStruct =~ /$DLstatement/g;
> > and try printing the array,
> > print "\nThe array is @m\n";
> > It prints nothing This is th
On 8/28/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
> When i write the condition
> my @m = $fullStruct =~ /$DLstatement/g;
> and try printing the array,
> print "\nThe array is @m\n";
> It prints nothing This is the problem...
>
> Thanks and Regards,
> Dharshana
snip
> > That i
Dharshana Eswaran wrote:
On 8/28/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 8/28/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
I have a pattern, which reads as shown below:
my $comment= qr{\s* (?:/\* .*? \*/ \s*)*}xs;
my $identifier = qr{ [A-Za-z_]\w* }xs;
my $statement = qr{
When i write the condition
my @m = $fullStruct =~ /$DLstatement/g;
and try printing the array,
print "\nThe array is @m\n";
It prints nothing This is the problem...
Thanks and Regards,
Dharshana
On 8/28/07, Chas Owens <[EMAIL PROTECTED]> wrote:
>
> On 8/28/07, Dharshana Eswaran <[E
On 8/28/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have a pattern, which reads as shown below:
>
> my $comment= qr{\s* (?:/\* .*? \*/ \s*)*}xs;
> my $identifier = qr{ [A-Za-z_]\w* }xs;
> my $statement = qr{
>\s*
>($identifier)
>
Hi All,
I have a pattern, which reads as shown below:
my $comment= qr{\s* (?:/\* .*? \*/ \s*)*}xs;
my $identifier = qr{ [A-Za-z_]\w* }xs;
my $statement = qr{
\s*
($identifier)
\s+
($identifier)
\s*
"Dharshana Eswaran" schreef:
> $xyz =~ /\s*(\w+)\s+(\w+);/;
> $b = $2; #variable name is stored here
>
> ...
>
> But the variables like pp_lac[COMMON_TYPE_MAX] and
> pp_plmn_list[COMMON_TYPE_MAX] are not getting stored because of the
> special character used inbetween the names.
The
Hi All,
I am trying to extract strings from few files. The content of the file reads
as shown
typedef struct
{
REFID_T pp_ref_id; /* destination */
CAUSE_T pp_cause;/* Reason registered */
STATE_T pp_state; /* State for indicators */
COMMON_TY
Dharshana Eswaran 写道:
Hi All,
I am trying to extract strings from few files. The content of the file
reads
as shown
typedef struct
{
REFID_T pp_ref_id; /* destination */
CAUSE_T pp_cause;/* Reason registered */
STATE_T pp_state; /* State for i
Of Course Rob, i always use strict and warnings... Since i had to write a
pseudocode, i did not write them. But i wil lsurely keep this in mind. :-)
Thank you... :-)
On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote:
Sure, though I do not see why you would not want to use strict and
warnings (you
Dharshana Eswaran wrote:
Hi All,
I am trying to extract few strings from a text file. The pattern of
the text
stored in the file is as follows:
#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01)
/* @LOG
MNSS_MESSAGE_T */
I need to extract MNSS_FACILITY_IND_ID, TF_MNSS_ME
Subject: Regarding pattern matching
Hi All,
I am trying to extract few strings from a text file. The pattern of the
text
stored in the file is as follows:
#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01) /*
@LOG
MNSS_MESSAGE_T */
I need to extract MNSS_FACILITY_IND_ID
Sure, though I do not see why you would not want to use strict and warnings
(you should should should or the people on this list will hunt you down and
) anyway Data::Dumper was just there for convenience:
#!/usr/local/bin/perl
#use strict;
#use warnings;
my $string = '#define MNSS_FACILIT
Thank you But i want to try without using any perl modules. Can you
suggest some way with no modules used in that?
Thanks and Regards,
Dharshana
On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote:
On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote:
>
> How about this?
>
>
> #!/usr/local/bin/pe
On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote:
How about this?
#!/usr/local/bin/perl
use strict;
use warnings;
my $string = '#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY
+ 0x01) /* @LOG MNSS_MESSAGE_T */';
my @parts = $string =~ m/\s+?(\w+)\s+?\((\w+.*?)\)[EMAIL PROTECTED]
How about this?
#!/usr/local/bin/perl
use strict;
use warnings;
my $string = '#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY +
0x01) /* @LOG MNSS_MESSAGE_T */';
my @parts = $string =~ m/\S+?(\w+)\s+?\((\w+.*?)\)[EMAIL PROTECTED](\w+).*/;
use Data::Dumper;
print Dumper @parts;
Hi All,
I am trying to extract few strings from a text file. The pattern of the text
stored in the file is as follows:
#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01) /* @LOG
MNSS_MESSAGE_T */
I need to extract MNSS_FACILITY_IND_ID, TF_MNSS_MESSAGE_CATEGORY + 0x01 and
MNSS
Dharshana Eswaran wrote:
On 3/9/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
Chas Owens wrote:
[snip]
(
\w+ |
\d+ |
0x[a-fA-F0-9]
That only matches a single hexadecimal digit, you probably want
0x[a-fA-F0-9
On 3/9/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
Chas Owens wrote:
> On 3/8/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
>>
>> I need to extract few strings from one file and paste it to another
file.
> snip
>
> This doesn't seem like a good job for split. The split function is
> good fo
Chas Owens wrote:
> On 3/8/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
>>
>> I need to extract few strings from one file and paste it to another file.
> snip
>
> This doesn't seem like a good job for split. The split function is
> good for parsing X separated records where X is either consta
or sometimes it can
be a 2 digit decimal number too.
the 3rd string is sometimes is not present.
Once these are extracted, i can process it further to the requirement.
I tried reading each line, splitting it using spaces, grouping them using
pattern matching and then displaying. The code, which i wr
On 3/8/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
Hi all,
I need to extract few strings from one file and paste it to another file.
snip
This doesn't seem like a good job for split. The split function is
good for parsing X separated records where X is either constant or
simple. What yo
mal number too.
the 3rd string is sometimes is not present.
Once these are extracted, i can process it further to the requirement.
I tried reading each line, splitting it using spaces, grouping them using
pattern matching and then displaying. The code, which i wrote for this, is
written at the
"Dharshana Eswaran" schreef:
> m/^ #TAPI (?:_[A-Z]+)+ $/x
>
> But this is filtering both the strings starting from TAPI and the
> strings starting from #TAPI.
Yes, "#" starts a comment, so makes the regex equivalent to m/^/, which
will allways match.
echo 'abc' |
perl -nle '
/^ # tes
On 2/21/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
On 2/21/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
>
> "Dharshana Eswaran" schreef:
>
> > TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
> > TAPI_TTY_NOTIFY_TTY_TONE_MSGID
> > [...]
> > Can anyone help me in getting a generalised pattern from thes
On 2/21/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"Dharshana Eswaran" schreef:
> TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
> TAPI_TTY_NOTIFY_TTY_TONE_MSGID
> [...]
> Can anyone help me in getting a generalised pattern from these?
m/^ TAPI (?:_[A-Z]+)+ $/x
--
Affijn, Ruud
"Gewoon is een tijger.
"Dharshana Eswaran" schreef:
> TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
> TAPI_TTY_NOTIFY_TTY_TONE_MSGID
> [...]
> Can anyone help me in getting a generalised pattern from these?
m/^ TAPI (?:_[A-Z]+)+ $/x
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Hello All,
I have quite a number of strings which has some typical matches between
them. I am unable to come up with a generalised pattern for them.
Few among those strings are like this:
TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
TAPI_TTY_NOTIFY_TTY_TONE_MSGID
TAPI_NOTIFY_CALL_LINE_INFO_MSGID
TA
}"
>
>
> This is stored as a string in a variable. I need to pull out only the
> numbers and store them in a array. Like:
>
> @array = (53, 65, 63, 75, 72, 69, 74, 79, 43, 6F, 64, 65, 00);
>
> I am unable to get a pattern to try pattern matching and spliting
it.
>
On 1/19/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
Igor Sutton wrote:
> I have an update:
>
>> my @data = $string =~ m/0x(\d{2})/g;
>
> my @data = $string =~ m/0x(\S{2}),?/g;
>
> Now I think it is right :)
my @data = $string =~ m/=0x(..)/g;
:)
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
F
On 1/19/07, Igor Sutton <[EMAIL PROTECTED]> wrote:
I have an update:
> my @data = $string =~ m/0x(\d{2})/g;
my @data = $string =~ m/0x(\S{2}),?/g;
Now I think it is right :)
--
Igor Sutton Lopes <[EMAIL PROTECTED]>
I used the above expression and it worked for me. Thanks you so much.
Tha
iable. I need to pull out only the
> numbers and store them in a array. Like:
>
> @array = (53, 65, 63, 75, 72, 69, 74, 79, 43, 6F, 64, 65, 00);
>
> I am unable to get a pattern to try pattern matching and spliting it.
>
> How do i do this?
$ perl -le'
my $string
Igor Sutton wrote:
I have an update:
my @data = $string =~ m/0x(\d{2})/g;
my @data = $string =~ m/0x(\S{2}),?/g;
Now I think it is right :)
my @data = $string =~ m/=0x(..)/g;
:)
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://le
I have an update:
my @data = $string =~ m/0x(\d{2})/g;
my @data = $string =~ m/0x(\S{2}),?/g;
Now I think it is right :)
--
Igor Sutton Lopes <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi Dharshana,
2007/1/19, Dharshana Eswaran <[EMAIL PROTECTED]>:
Hi All,
I have a string as shown below:
$string =
"{[0]=0x53,[1]=0x65,[2]=0x63,[3]=0x75,[4]=0x72,[5]=0x69,[6]=0x74,[7]=0x79,[8]=0x43,[9]=0x6F,[10]=0x64,[11]=0x65,[12]=0x00}"
This is stored as a string in a variable. I need to pul
e:
@array = (53, 65, 63, 75, 72, 69, 74, 79, 43, 6F, 64, 65, 00);
I am unable to get a pattern to try pattern matching and spliting it.
How do i do this?
Thanks and Regards,
Dharshana
[EMAIL PROTECTED] wrote:
>
> [EMAIL PROTECTED] writes:
>>
>> [EMAIL PROTECTED] wrote:
>>>
>>> Hi,
>>>
>>> I am a beginner in perl and am having a dickens of a time trying to
>>>
>>> identify this pattern in messages. [URL
>>>
>>> Here is what I have:
>>>
>>> if ($FORM{'message} =~ /\[URL/ig)
In a message dated 7/23/2006 9:39:34 A.M. Pacific Standard Time,
[EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
> Hi,
>
> I am a beginner in perl and am having a dickens of a time trying to
identify
> this pattern in messages. [URL
>
> Here is what I have:
>
> if (
1 - 100 of 474 matches
Mail list logo