I have requirement where I need to capture the highest values of
items from a feed that runs for N hours.
For example lets assume my data looks like this
first feed
========
appples 10
oranges 20
pears 14
second feed
==========
apples 5
oranges 30
pears 1
Last feed
=======
apples 6
oranges 1
pears 4
At the end of my script this would be my output
apples 10
oranges 30
pears 14
I know I can write this all out to a file and than sort the file and look
for the highest values that way but I was wondering if this can be done
with an 2 dimensioal array if ksh supports it or with a more elegant
solution as writing all this data to a file may file up my file system.
my code would need to look something like this
My solution does not need to be an array but I am really trying to
avoid writing data to files if possible until the very end...
I have 2 arrays of values for example
A1 ={10 15 3 21}
A2 ={10 15 3 22}
I need to check which one has greater values. However:
A1 ={10 15 3 21}
A2 ={10 15 3 21 3} - this one would be greater.
A1 ={10 15 5 21} - this one greater
A2 ={10 15 3 21}
Basically, I want to compare patch... (6 Replies)
Hi all,
In ksh, I'm trying to loop through all of my arrays, named array1, array2, array3..., and update the indices. But I'm getting errors and I'm not sure how to fix them. The errors are
./parse.sh: 6+1: not found
The code is:
eval \${array$c}=$(eval \${array$c}+1 )
Any help... (12 Replies)
Hi all,
We have requirement to generate load timing based on subject areas HOUSEHOLD, BANKING and TRADING. These values are stored in an array SUB_ARR
SUB_ARR=("HOUSEHOLD" "BANKING" "TRADING")
Based on indicator files produced while processing data for each type, we need to get the stats (using... (2 Replies)
Hi
I have redc containing the values 3, 6, 2, 8, and 1.
I have work containing the values 8, 2, 11, 7, and 9.
Is there a way to find the sum of redc and work?
I need to compare the sum of those two arrays to something else, so is it okay to put that into my END?
TY! (4 Replies)
if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
I have the following csh script which lets the use pass the following as an argument
-legend=tag1/tag2/tag3/tag4/tag5/tag6/tag7
We pass a number of tags separated by '/'. I want to save the legend tags in an array and have done as below. How can I improve on this as things are getting quite... (3 Replies)
Hey Gang!
So I have two Arrays. @linecount and @hit. Now these arrays contain numbers which I'm using as line placeholders on files. I need these two arrays to sync up and not repeat a number.
Here are the contents (spam alert)
@linecount
1
28
53
86
87
88
89
90
91
92
93
94 (5 Replies)
I am reading a number of files but then I want to put the ranges
xmin xmax ymin ymax
as arrays for each file.
Any idea how I can do this???
set j = 1
echo "Welcome $i times"
while ( $j <= $i )
echo "$j"
set fname = $fin-bst-misf.xy
echo " "$fname
... (0 Replies)
Friends,
I have to execute a command and store its contents into an array using shell. this is what i have tried
#!/bin/bash
disk_names = ($(`iostat -xtc | egrep -v "device|nfs" | awk '{print $1}'| tr '\n' ' ' `))
But its throwing an error message as
./test-script
./test-script:... (6 Replies)
Hi All,
I want to concatenate the array cell values and form a string.. Is it possible?
for ex.
I have an array
word_array contains d u m b and after concatenating the string shld be 'dumb'
thanks (2 Replies)