Richard Lee wrote:
Can you please tell me how to shorten this?
my @an = split(//);
my @num = grep { $_ eq ':' } @an ;
I was trying to see how many : occur in variable but didn't know how to
do it fast so i did it like above...
I would like to see as many way different ways to get this done i
Can you please tell me how to shorten this?
my @an = split(//);
my @num = grep { $_ eq ':' } @an ;
I was trying to see how many : occur in variable but didn't know how to
do it fast so i did it like above...
I would like to see as many way different ways to get this done if possible
thank yo
Here's a tiny code to get the prompt, hope it helps
$actualprompt='';
$rootexpect->send("\n");
my $shpromvrfy = $rootexpect->expect(750,'#','>','$');
my $match=$rootexpect->match();
my @outp = split /\n/, $rootexpect->exp_before();
$actualprompt= "$o
Hi all,
My code is below
*My code runs;*
when run $array[$j][1] = 101-P-467593 ( this value is stored in excel
file and this value input by hand ) and $accountNumber = 101-P-467593
*My code doens't run :*
when run $array[$j][1] = 101-P-467593 ( this value is stored in excel
file and it is re
Anirban Adhikary wrote:
I have a csv file having the following contents.
col1 col2 col3
"A", "1","2"
"B","1", "3"
"C","2","4"
"D","1","5"
"A","1","6"
"B","2","7"
"C","2","8"
" ","3","9"
Now I want to implement a logic which will show me the summarize records as
follows
col1 count
A- 2
B - 2
perl_learner wrote:
On May 5, 3:26 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
my @kits = qw( aaa.t.z aaa_d.t.z bbb.t.z bbb_d.t.z
ccc.t.z ccc_d.t.z ddd.t.z eee.t.z );
my %hash = map {
( my $tmp = $_) =~ s/_d(\.t\.z)$/$1/; $tmp => 1
} grep /_d\.t
Jenda Krynicky wrote:
From: Robert Hicks <[EMAIL PROTECTED]>
Is there anything wrong with:
if ( defined $one && defined $two && $one eq $two ) {
do something
}
As far as I can tell not. I was afraid the operator precedence might
play tricks with it, but looks like it doesn't:
V:\>
From: David Newman <[EMAIL PROTECTED]>
> However, it doesn't answer the root question, namely how to parse text
> that contains Western European characters such as accents and umlauts.
>
> I see from the Text::CSV documentation that this module handles only
> characters between 0x20 and 0x7e. I
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
code of Gunnar's
my $numbers_wanted = 2;
my ( @datawanted, @numbers );
LOOP: foreach ( @datas ) {
my @test = split;
foreach my $num ( @numbers ) {
next LOO
From: Robert Hicks <[EMAIL PROTECTED]>
> Is there anything wrong with:
>
> if ( defined $one && defined $two && $one eq $two ) {
> do something
> }
As far as I can tell not. I was afraid the operator precedence might
play tricks with it, but looks like it doesn't:
V:\>perl -MO=Deparse
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
code of Gunnar's
my $numbers_wanted = 2;
my ( @datawanted, @numbers );
LOOP: foreach ( @datas ) {
my @test = split;
foreach my $num ( @numbers ) {
next LOOP if grep( $num->{$_}, @tes
David Newman wrote:
On 3/20/08 5:05 PM, Gunnar Hjalmarsson wrote:
David Newman wrote:
I have some CSV input files that contain control and extended ASCII
characters,
The Text::CSV or Tie::Handle::CSV modules don't like these
characters; the snippets below both return errors when they get t
Rodrigo Tavares wrote:
Hello,
I create a hash, and i want take the keys.
Using Deitel Book, i take this example:
numbers =
(
1 => 'one',
3 => 'two',
5 => 'three',
7 => 'four',
9 => 'five',
);
@hashkey = key
On 3/20/08 5:05 PM, Gunnar Hjalmarsson wrote:
David Newman wrote:
I have some CSV input files that contain control and extended ASCII
characters,
The Text::CSV or Tie::Handle::CSV modules don't like these characters;
the snippets below both return errors when they get to one.
my $csv =
On Tue, May 6, 2008 at 10:43 AM, Rodrigo Tavares
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> I create a hash, and i want take the keys.
> Using Deitel Book, i take this example:
>
> numbers =
> (
>1 => 'one',
>3 => 'two',
>5 => 'three',
>7
On Tue, May 6, 2008 at 9:49 AM, Robert Hicks <[EMAIL PROTECTED]> wrote:
> Is there anything wrong with:
>
> if ( defined $one && defined $two && $one eq $two ) {
> do something
> }
No. Its fine.
You might be interested in "Operator Precedence and Associativity" [1]
[1] http://perldoc.pe
Hello,
I create a hash, and i want take the keys.
Using Deitel Book, i take this example:
numbers =
(
1 => 'one',
3 => 'two',
5 => 'three',
7 => 'four',
9 => 'five',
);
@hashkey = keys (%numbers);
When I try
I'm sure someone more experienced will have a far more elegant
solution, but something along these lines might work.
(Note: code untested)
%count;
while (<>) {
if ($_ =~ /^"([^"]*)"/) {
%count{$1}++;
}
}
for (keys %count) {
print "$_ - $count{$_}\n";
}
or, refractored,
%count;
while (<
Is there anything wrong with:
if ( defined $one && defined $two && $one eq $two ) {
do something
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On May 5, 3:26 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
> perl_learner wrote:
> > Hi,
>
> > I have these type of kits in unix location.
>
> > aaa.t.z aaa_d.t.z bbb.t.z bbb_d.t.z ccc.t.z ccc_d.t.z ddd.t.z eee.t.z
> > (there will be more numbers).
>
> > I have to come up with idea, so that ,
Have been googling for some time now and every command I tried fails. I
want to use sed from the command line or use it in a windows batch file to
split on a pipe delimited file, windows server. The examples have \n as the
carriage return code, but all that happens is the pipe is replaced by t
Dear list
I have a csv file having the following contents.
col1 col2 col3
"A", "1","2"
"B","1", "3"
"C","2","4"
"D","1","5"
"A","1","6"
"B","2","7"
"C","2","8"
" ","3","9"
Now I want to implement a logic which will show me the summarize records as
follows
col1 count
A- 2
B - 2
C - 2
D - 1
22 matches
Mail list logo