Perl: find next available lowest number that is available in two arrays
Hi there. I have a number allocation problem whereby I have 2 arrays built from 2 different sources. The arrays will just contain a listed of sorted numbers
i need to scan both arrays and find the lowest available number that is available in both arrays that is higher than $min which is set to "10". once it finds the the lowest unused number, it quits and presents it in a variable
So in the case of the two arrays above, the number that would get presented is 12 (as 11 is used in one of the arrays)
I have been trying various things such as setting a counter and looping through the two arrays but have been getting myself in a real pickle of infinate loops and utter mess
I wanted to ask whether anyone could point me in the right direction on the best way to tackle this one?
any advice or guidance would be greatly appreciated
Hi Guys,
I am looking for a way to sort the output below from the "Inuse" count from Highest to Lowest. Is it possible?
Thanks in advance.
user1 0.12 0.06 0 0.12
User Inuse Pin Pgsp Virtual
Unit:... (4 Replies)
Hi Perl Experts,
Could somebody help me how to solve my problem if I have array contains the following data:
"SEQ-0 UNSORT2 0",
"SEQ-1 UNSORT2 1",
"SEQ-2 UNSORT2 2",
"SEQ-3 UNSORT2 3",
<--- Missing the... (0 Replies)
i am having a problem finding the lowest number after punching in a bunch of numbers in the .txt file but its probably the way i have the code set up.
help please! (4 Replies)
Hello all,
How can I find the lowest number every 10 lines? For example i have a list
name1
-0.1
name2
2
name3
3
name4
-3
name5
1
name6
2
name7
34
name8
34 (6 Replies)
I'm writing a KSH script that will get a file on the command line (such as input.txt), and in this file there is on number per line. The program needs to take the file, read each and determine the lowest number in the file. I currently have a while loop setup that will correctly out put every... (8 Replies)
Hi,
Could someone please help me with this? I have two arrays and I need to generate third array containing difference between the two. For example -
@Array1 = ;
@Array2 = ;
I would like to find difference between these two and generate third array that contains the difference. In... (5 Replies)
How would one go about finding the greatest number in an array of numbers using loops and if statements? For example, if you had an array like this:
(4, 8, 3, 19, 6, 11) (3 Replies)
Hi i want to ask how can i use perl and find a word in a text file, and also telling that which page doesn't it exist?
Eample: have a 10 pages text file, then i need to find 'Hello' in the file, and show that which page is it contain in.
Output: Hello contains 8 times in page 1, 3, 4, 7, 10... (9 Replies)
I need to create arrays like this:
cnt=0
{ while read myline; do
if ];then
firstpass="${myline##<meas>}"
meas="${firstpass%%</meas>}"
tempmeas="${meas%%;*}"
MEAS$cnt=$tempmeas
print $cnt
print ${MEAS'$cnt'}
... (2 Replies)