AITHA, BHEEMSEN (SBCSI) wrote:
> Hi list,
>
> I would like to create an array in the following format:
>
>
> 123 abc,xyz,pqr
> 234 xyz
> 456 wer,tre
> ---
> ---
>
> I want to use a command like the following
>
> push @first_array,from second_array>;
>
> where the_number = values i
Hi list,
I would like to create an array in the following format:
123 abc,xyz,pqr
234 xyz
456 wer,tre
---
---
I want to use a command like the following
push @first_array, ;
where the_number = values in 1st column coming from a variable in a loop.
The values in second column ar
Thanx Craig.
That worked. I have another question.
I would like to create an array in the folowing format:
123 abc,xyz,pqr
234 xyz
456 wer,tre
---
---
I want to use a command like the following
push @first_array, ;
where the_number = values in 1st column coming from a variable
Thanx Dave. I had executed the exact script sent by you.
But the out put on the screen was
grep -E -i -c "abc|Xyz|PQr" test.txt
So, print $var is printing the command string itself and not the out put of
grep command.
Did I miss anything ?
Thanx..
-Bheem
-Original Message-
From: [EMA
Sorry All...
The 'die' command should have read:
die "ERROR: Problem executing grep, ($!), stopped" if ( $? == 2 );
grep return codes: 0=Found Match; 1=No Match Found; 2=Error.
Dave.
-Original Message-
From: Deline, David B.
Sent: Monday, February 18, 2002 3:08 PM
To: 'ba2984'
C
You appear to be trying to use the command-line version of grep, rather than
a Perl grep. To get what you appear to be looking for in Perl would require
opening the file:
Script: grep.pl
#!perl -w
use strict ;
my $fn = "test.txt" ;
open(INFILE, $fn) or die "Can'
The back-tics will automatically execute the grep command.
So,
$var=`grep -E -i -c "abc|xyz|pqr" test.txt`;
will execute the grep command just like from the shell command line.
The output from the grep command will be captured in $var.
You can check the value of $? for the return value from
Then how do I execute the command in $var ? I want to check the return code
of that grep command. Please help me. I am new to PERL.
Thanx..
-Bheem
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 11:47 AM
To: AITHA, BHEEMSEN (SBCSI)
Cc
Is that the exact line...?
Try:
$var=`grep -E -i -c "abc|xyz|pqr" test.txt`;
Remember to put your shell commands in back-tics...
Dave.
-Original Message-
From: ba2984 [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 1:23 PM
To: perl-unix-users
Subject: [Perl-unix-users] Please
Hi listers,
I am using the following command in my perl script. But when I execute the
script I am getting the error
"Unrecognized file test: -E at test.pl line 9."
grep -E -i -c "abc|xyz|pqr" test.txt ;
Can someone please tell me what I am doing wrong here ?
All I wanted to do is to search
Cool
thanks.
Marty
> -Original Message-
> From: Fay Jason-W13246 [mailto:[EMAIL PROTECTED]]
> Sent: Monday 18 February 2002 16:22
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: RE: [Perl-unix-users] Joining Databases
>
>
> In your code, you are using what O
In your code, you are using what Oracle calls a database link. When you declare the
tables to query from, the \@STAGE001 is specifying a link to another database. I
don't know if mysql or postgreSQL have database links. In Oracle, you need to have
the link set up before the SQL will work.
G
In Oracle, I believe that the answer to your question is yes ( I am not
familiar with the others ).
Here is a snippet of a .pm that I run using Oracle as the database, it is
ugly but maybe it is what you are looking for.
my $sth = $self->{'dbc'}->prepare("select c.TAG_NAME
Daft question,
Is it possible to join databases without making two calls. I.e. can the join
be done within SQL, not using 2 $db references?
Not sure which databases yet, but probably mysql, oracle, postgreSQL.
Regards
Marty
___
Perl-Unix-Users maili
14 matches
Mail list logo