11-01-2007
Thanks jim
You have given reply is very usefull. again thanks to you.
Just in Below code I have change array box with [] and add new code for print the array member.
#!/usr/bin/ksh
let i=0
#set -A arr
echo "select param_value
from control_param
where pgm_name = 'EXS_PROCESS';
exit
" | sqlplus -s ${ora_user}/${ora_passwd}@${ORACLE_SID} | \
while read line
do
if [[ $i -gt 2 ]]
then
arr[$i-3]="$line"
fi
let i=$i+1
done
echo "Array Variable is Filled Up"
i=0
echo " Total no. of member ${#arr[@]} "
echo "Print the Array member"
while [ $i -lt ${#arr[@]}-1 ]
do
print ${arr[$i]}
(( i=i+1 ))
done
echo "After Array Print"
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all,
I have a file having the following formats:
ThreadFail=Web1=1234
ThreadFail=Web2=2345
ThreadFail=Web3=12
ConnectionFail=DB1=11
ConnectionFail=DB2=22
The number of lines will be different from every time . How can I parse the file and store the result to an a array inside... (6 Replies)
Discussion started by: youareapkman
6 Replies
2. Shell Programming and Scripting
Can someone tell me why I'm getting error when I try to run this?
#!/bin/csh -f
source ~/.cshrc
#
set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus
#
set count=`$SQLPLUS -s ${DB_LOGIN} << END
select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;... (7 Replies)
Discussion started by: gregrobinsonhd
7 Replies
3. Shell Programming and Scripting
Hello,
Can someone please advise me how to put the db2 query reult into an array?
For example, the query reults are:
string A
string B
string C
Then how do I put them into array=string A
array=string B
... (2 Replies)
Discussion started by: hanul
2 Replies
4. Shell Programming and Scripting
Hi,
I have few variable say 10
ex:-
l_pc_291334_01_0_01_00.cmp
l_pc_441133_50_0_02_00.cmp
l_pc_441133_55_0_02_00.cmp
Each variable value is coming via loop on a table.
I want to create a script that stores these value to a table or array ( But one by one not all at one time as... (4 Replies)
Discussion started by: amitkumar.b2
4 Replies
5. Shell Programming and Scripting
Hi to all,
I have this input:
<group>
<x "2">Group D</x>
<x "3">Group B</x>
<x "1">Group A</x>
</group>
<group>
<x "1">Group E</x>
<x "0">Group B</x>
<x "1">Group C</x>
</group>
<group> ... (11 Replies)
Discussion started by: Ophiuchus
11 Replies
6. Shell Programming and Scripting
Dear All,
I have been trying to do a simple task of extracting 2 fields from the file (3 rows) and store it in an array variable. I tried with:
#! /bin/bash
ch=`cut -f10 tmp.txt`
counter=0
for p in $pid
do
c=${ch}
echo "$c ..$counter"
counter=$((counter+1))... (2 Replies)
Discussion started by: ezhil01
2 Replies
7. Programming
Hi,
I wrote the below script to get the query result from a Syabase DB.
isql -s -U **** -P **** SYBASE SERVERNAME
USE ***(Database name in Sybase)
@command.sql
But im not getting the output. Can anyone help me on this (2 Replies)
Discussion started by: rohan G
2 Replies
8. Shell Programming and Scripting
Friends have the following problem:
cat $PATH_DAT/mr.txt | nawk 'BEGIN {
CantPnt=0;
NumReg=0;
FS="|"
}
{
NumReg++
CantPnt=CantPnt+int($2)
}
END{
printf... (5 Replies)
Discussion started by: tricampeon81
5 Replies
9. Shell Programming and Scripting
I can not figure out how to capture the $filename variable store by the bash.
#!/bin/bash
# oldest folder stored as variable for analysis, version log created, and quality indicators matched to run
dir=/home/cmccabe/Desktop/NGS/test
find "$dir" -maxdepth 1 -mindepth 1 -type d -printf... (5 Replies)
Discussion started by: cmccabe
5 Replies
10. Shell Programming and Scripting
I'm trying to achieve the follwoinig with no luck.
Find the directories that are greater than 50GB in size and pick the owner of the directory as I would like to send an alert notification.
du -sh * | sort -rh
139G Dir_1
84G Dir_2
15G Dir_3
ls -l Dir_1
drwx------ 2... (3 Replies)
Discussion started by: 308002184
3 Replies
LEARN ABOUT PHP
collator_asort
COLLATOR_ASORT(3) 1 COLLATOR_ASORT(3)
Collator::asort - Sort array maintaining index association
Object oriented style
SYNOPSIS
public bool Collator::asort (array &$arr, [int $sort_flag])
DESCRIPTION
Procedural style
bool collator_asort (Collator $coll, array &$arr, [int $sort_flag])
This function sorts an array such that array indices maintain their correlation with the array elements they are associated with. This is
used mainly when sorting associative arrays where the actual element order is significant. Array elements will have sort order according to
current locale rules.
Equivalent to standard PHP asort(3).
PARAMETERS
o $coll
-Collator object.
o $arr
-Array of strings to sort.
o $sort_flag
- Optional sorting type, one of the following:
o Collator::SORT_REGULAR - compare items normally (don't change types)
o Collator::SORT_NUMERIC - compare items numerically
o Collator::SORT_STRING - compare items as strings
Default $sort_flag value is Collator::SORT_REGULAR. It is also used if an invalid $sort_flag value has been specified.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
collator_asort(3)example
<?php
$coll = collator_create( 'en_US' );
$arr = array(
'a' => '100',
'b' => '50',
'c' => '7'
);
collator_asort( $coll, $arr, Collator::SORT_NUMERIC );
var_export( $arr );
collator_asort( $coll, $arr, Collator::SORT_STRING );
var_export( $arr );
?>
The above example will output:
array (
'c' => '7',
'b' => '50',
'a' => '100',
)array (
'a' => '100',
'b' => '50',
'c' => '7',
)
SEE ALSO
Collator constants, collator_sort(3), collator_sort_with_sort_keys(3).
PHP Documentation Group COLLATOR_ASORT(3)