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
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
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've
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 first-person pronouns (and 3
Thank you for the feedback. I do apologize for not posting a working
example; I can't post the full code and I was attempting to extract the
offending sections.
I have no particular fondness for grep. A search of postings on perlmonks
revealed a variation of the code I employed. I am learning
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:
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
Hi all,
I have tried various regular expressions to remove null or empty
values on array @array1 and create a new array @OPD01 with the values.
This, however, does not work as I still get a number of empty values
in the @OPD01 array after this processing. As you'll see I tried
various things -
Am Dienstag, 10. Mai 2005 11.01 schrieb Tielman Koekemoer (TNE):
Hi all,
I have tried various regular expressions to remove null or empty
values on array @array1 and create a new array @OPD01 with the values.
This, however, does not work as I still get a number of empty values
in the @OPD01
Tielman Koekemoer (TNE) [TK], on Tuesday, May 10, 2005 at 11:01
(+0200) contributed this to our collective wisdom:
TK I have tried various regular expressions to remove null or empty
TK values on array @array1 and create a new array @OPD01 with the values.
TK This, however, does not work as I
Hi John,
Try to use 'chop' to get null value
Thanks and Regards
Pramod
John Doe wrote:
Am Dienstag, 10. Mai 2005 11.01 schrieb Tielman Koekemoer (TNE):
Hi all,
I have tried various regular expressions to remove null or empty
values on array @array1 and create a new array @OPD01 with the values.
$counter2 = 0;
What's that for? (never used)
Hmm yeah sorry that was supposed to be $counter = 0;
Use push() to avoid holding the current array index.
What do you mean by holding the index?
my @array1=(' ', 'a', '', 'b', \0, 'c', undef, 'd', ' ', 'e'); my
@new=grep {$_ and !/^\s+$/ and
Ah I see: use push() to add scalars/lists to arrays.
Thanks everyone for the help.
Use push() to avoid holding the current array index.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Am Dienstag, 10. Mai 2005 11.46 schrieb Tielman Koekemoer (TNE):
$counter2 = 0;
What's that for? (never used)
Hmm yeah sorry that was supposed to be $counter = 0;
Use push() to avoid holding the current array index.
What do you mean by holding the index?
remember (and incrementing) the
Am Dienstag, 10. Mai 2005 11.23 schrieb Kpramod:
Hi John,
Try to use 'chop' to get null value
Thanks and Regards
Pramod
Hi Pramad,
sorry, I don't understand what you mean. Do you refer to the line
my @new=grep {$_ and !/^\s+$/ and !/^\0+$/} @array1;
(I see that the test for \0 is ugly,
On 2004-02-26 00:43:21 +, [EMAIL PROTECTED] (Wolf Blaum) said:
As I understand Biology, there is 4 nucleotid acids which gives 4**2
combinaions for dupplets. So you need 8 vars to count the occourence of
all douplets. Worse for triplets. (24)
As I understand genetics, triplets are what
On Thursday 26 February 2004 12:28, Henry Todd generously enriched virtual
reality by making up this one:
On 2004-02-26 00:43:21 +, [EMAIL PROTECTED] (Wolf Blaum) said:
As I understand Biology, there is 4 nucleotid acids which gives 4**2
combinaions for dupplets. So you need 8 vars to
On Wed, Feb 25, 2004 at 04:35:57PM +, Henry Todd ([EMAIL PROTECTED]) wrote:
I'm having trouble counting the number of specific substrings within a
string. I'm working on a bioinformatics coursework at the moment, so my
string looks like this:
If you don't get an answer to your question
I'm having trouble counting the number of specific substrings
within a
string. I'm working on a bioinformatics coursework at the
moment, so my
string looks like this:
$sequence = caggaactttcggaagaccatgta;
I want to count the number of occurrences of each pair of
letters, for
Kenton Brede wrote:
I'm having trouble counting the number of specific substrings within a
string. I'm working on a bioinformatics coursework at the moment, so my
string looks like this:
If you don't get an answer to your question this is probably why -
On Wed, Feb 25, 2004 at 05:52:19PM -, Rob Dixon ([EMAIL PROTECTED]) wrote:
Kenton Brede wrote:
I'm having trouble counting the number of specific substrings within a
string. I'm working on a bioinformatics coursework at the moment, so my
string looks like this:
If you don't get
On 2004-02-25 17:42:46 +, [EMAIL PROTECTED] (Kenton Brede) said:
If you don't get an answer to your question this is probably why -
http://learn.perl.org/beginners-faq#2.2%20%20what%20is%20this%20list%20_not_%20for
Kent
Kent
Kent
Kent -
Thanks for the pointer. I should have read the
Kenton Brede wrote:
On Wed, Feb 25, 2004 at 05:52:19PM -, Rob Dixon ([EMAIL PROTECTED]) wrote:
Kenton Brede wrote:
I'm having trouble counting the number of specific substrings within a
string. I'm working on a bioinformatics coursework at the moment, so my
string looks like
Henry Todd wrote:
[snip]
This is how I'm counting the number of cc pairs at the moment ($cc is
my counter variable):
$cc++ while $sequence =~ /cc/gi;
But this only matches the literal string cc, so if, as it scans
$sequence, it finds it's only counting it once instead of three
Henry Todd wrote:
I'm having trouble counting the number of specific substrings within a
string. I'm working on a bioinformatics coursework at the moment, so my
string looks like this:
$sequence = caggaactttcggaagaccatgta;
I want to count the number of occurrences of each pair of
Henry Todd wrote:
On 2004-02-25 17:42:46 +, [EMAIL PROTECTED] (Kenton Brede) said:
If you don't get an answer to your question this is probably why -
http://learn.perl.org/beginners-faq#2.2%20%20what%20is%20this%20list%20_not_%20for
Thanks for the pointer. I should have read the
On Wed, Feb 25, 2004 at 06:30:55PM -, Rob Dixon ([EMAIL PROTECTED]) wrote:
Kenton Brede wrote:
On Wed, Feb 25, 2004 at 05:52:19PM -, Rob Dixon ([EMAIL PROTECTED]) wrote:
Kenton Brede wrote:
I'm having trouble counting the number of specific substrings within a
string.
On Wed, Feb 25, 2004 at 06:12:55PM +, Henry Todd ([EMAIL PROTECTED]) wrote:
On 2004-02-25 17:42:46 +, [EMAIL PROTECTED] (Kenton Brede) said:
If you don't get an answer to your question this is probably why -
Kenton Brede wrote:
I just didn't want the OP to be hanging waiting for an answer when non
would be forthcoming.
Not a mistake per se -- however Perl people (read POD) will always want
to show off -- so, if it is Perl, it is likely answered.
:)
-Sx-
(let's not mention cpl.mod)
Hi all -
Many thanks to those who shared their knowledge. I had a feeling that
there would be an elegant solution to my problem, but I was having no
luck figuring it out.
For reference, where before my code was:
$Pcc++ while $sequence =~ /cc/gi;
..it is now:
$Pcc++ while $sequence =~
Kenton Brede wrote:
OK my mistake. I've been on newsgroups/lists where the no homework rule
is enforced and just assumed the FAQ was literal, except for the
monkey parts of course.
I just didn't want the OP to be hanging waiting for an answer when non
would be forthcoming.
Hmm.
Kenton Brede wrote:
Well it seems there is confusion on my part as to which part of the FAQ
to follow. I'm sure there are tons of homework questions done for people
who disguise them. That is one reason I've always felt the no homework
rule is superfluous. Personally I have no problem with
From: Bakken, Luke [mailto:[EMAIL PROTECTED]
Sent: Thursday, 26 February 2004 4:59 AM
To: Henry Todd; [EMAIL PROTECTED]
Subject: RE: Pattern matching problem
I'm having trouble counting the number of specific substrings
within a
string. I'm working on a bioinformatics coursework
On Wednesday 25 February 2004 17:35, Henry Todd generously enriched virtual
reality by making up this one:
Hi,
I'm having trouble counting the number of specific substrings within a
string. I'm working on a bioinformatics coursework at the moment, so my
string looks like this:
$sequence =
Kenton Brede wrote:
On Wed, Feb 25, 2004 at 05:52:19PM -, Rob Dixon ([EMAIL PROTECTED]) wrote:
Kenton Brede wrote:
I'm having trouble counting the number of specific substrings within a
string. I'm working on a bioinformatics coursework at the moment, so my
string looks like
Hi all,
I'm trying to split apart a filepath...e.g:
c:\test\abc\what\somefile.txt
The length of the filepath will never be constant...
e.g:
foreach $line (@Path_Filename)
{
chomp($line);
(@Path_Breakdown) = split(/(\w+\W)(\w+\W)/, $line);
}
but my biggest problem is how to match
10, 2003 9:22 AM
To: [EMAIL PROTECTED]
Subject: file path pattern matching problem.
Hi all,
I'm trying to split apart a filepath...e.g:
c:\test\abc\what\somefile.txt
The length of the filepath will never be constant...
e.g:
foreach $line (@Path_Filename)
{
chomp($line
Ben Crane wrote:
Hi all,
Hello,
I'm trying to split apart a filepath...e.g:
c:\test\abc\what\somefile.txt
The length of the filepath will never be constant...
$ perl -le'
use File::Spec;
my $path = q[c:\test\abc\what\somefile.txt];
my ( $vol, $dir, $file ) = File::Spec-splitpath( $path
matching problem.
Ben Crane wrote:
Hi all,
Hello,
I'm trying to split apart a filepath...e.g:
c:\test\abc\what\somefile.txt
The length of the filepath will never be constant...
$ perl -le'
use File::Spec;
my $path = q[c:\test\abc\what\somefile.txt];
my ( $vol, $dir, $file ) = File::Spec
The best way to do it; is using the standard module File::Basename.
For instance
use File::Basename;
# This should return somefile.
$file_name = basename (c:\test\abc\what\somefile.txt);
# This should also return c:\test\abc\what\
$dir_name = dir (c:\test\abc\what\somefile.txt);
# fileparse
Hi, All!
I'm very new in Perl, so may be I'm doing something wrong.
Please help me with this :
my script read configuration file, that looks like this:
#-
#hostname #username #Path#gzip
after #delete after
hpn003
/^$/ matches a blank line, /^\$/ will do the job for you.
$ is a metacharacter, you will have to escape it. It matches at the end of a
line or before newline at the end.
hth.
Sudarsan
Tanya Bar wrote:
Path could be physical or start with environment variable; so in my script
I'm trying to
Some other notes...
You don't have to use printf - you can use print. And you don't need the
brackets, or the inverted commas around $path:
if ($path =~ m/^\$/) {
print Path is env var\n;
} else {
print Working on phys.dir\n;
}
if ( $path =~ /^$/ ) {
printf(path is env
43 matches
Mail list logo