Sponsored Content
Top Forums Shell Programming and Scripting Using perl code find greatest number. Post 302345402 by DemonixX on Wednesday 19th of August 2009 07:22:22 AM
Old 08-19-2009
Using perl code find greatest number.

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)
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl find page number in a file

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)
Discussion started by: mingming88
9 Replies

2. Shell Programming and Scripting

finding greatest value in a column using awk from iostat output in linux

Friends, Need some help. On linux i have to run iostat command and in each iteration have to print the greatest value in each column. e.g iostat -dt -kx 2 2 | awk ' !/sd/ &&!/%util/ && !/Time/ && !/Linux/ {print $12}' 4.38 0.00 0.00 0.00 WHhat i would like to... (15 Replies)
Discussion started by: achak01
15 Replies

3. UNIX for Dummies Questions & Answers

help! script to select line with greatest value 2 between columns

Hi, I’m trying to do something I haven’t done before and I’m struggling with how to even create the command or script. I have the following space delim file: gene accession chr chr_st begin end NN1 NC_024540 chr3 - 14000 14020 NN1 ... (10 Replies)
Discussion started by: wolf_blue
10 Replies

4. Shell Programming and Scripting

Perl : print the sequence number without missing number

Dear Perl users, I need your help to solve my problem below. I want to print the sequence number without missing number within the range. E.g. my sequence number : 1 2 3 4 5 6 7 8 11 12 13 14 my desired output: 1 -8 , 11-14 my code below but still problem with the result: 1 - 14 1 -... (2 Replies)
Discussion started by: mandai
2 Replies

5. Shell Programming and Scripting

Perl - how to find the number based on the same name

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)
Discussion started by: askari
0 Replies

6. Shell Programming and Scripting

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 @a 1 7 10 14 15 16 @b 1 7 10 11 14 15 16 (2 Replies)
Discussion started by: hcclnoodles
2 Replies

7. Shell Programming and Scripting

Take greatest value from second column

Dear All, Please help me, I have file input like this, 1 2142 215 2162 217 2842 285 2862 287 4002 401 4022 403 4822 1 2142 215 2162 217 2842 285 2862 287 4002 401 4022 403 4882 1 4801 (8 Replies)
Discussion started by: attila
8 Replies

8. Shell Programming and Scripting

Find and replace, perl code

Hi, Can somebody tell whats wrong with "find and replace perl code". I wanted to find "\n".write(status,data" and replace with "\n",data" in multipls files. #!/usr/bin/perl my @files = <*.c>; foreach $fileName (@files) { print "$fileName\n"; my $searchStr0 =... (4 Replies)
Discussion started by: chettyravi
4 Replies

9. Shell Programming and Scripting

awk to find number in a field then print the line and the number

Hi I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field. The source file is pipe delimited and looks something like 1|net|ABC Letr1|1530||| 1|net|EXP_1040 ABC|1121||| 1|net|EXP_TG1224|1122||| 1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies
DXmSvnGetSelections(3X) 												   DXmSvnGetSelections(3X)

NAME
DXmSvnGetSelections - Retrieves (returns) a list of selected entry numbers. SYNOPSIS
void DXmSvnGetSelections( Widget widget, int *entries(), int *comps(), XtPointer *tags(), int len ); PARAMETERS
The identifier (widget ID) of the SVN widget. A pointer to an array of integers to receive the selected entry numbers. A pointer to an array of integers to receive the component numbers on which the entry was selected. A component number of 0 means that the entry was selected using range selection and not by directly clicking on the entry. If components are not needed, a Null pointer may be passed. A pointer to an array of longwords to receive the application tag value for each entry selected. If tags are not needed, a Null pointer may be passed. An integer that represents the number of entries allocated in the provided array. DESCRIPTION
The DXmSvnGetSelections routine returns a list of entries that are currently selected by the user. Make this call in your application between calls to DXmSvnDisableDisplay and DXmSvnEnableDisplay to ensure that the selected list is not changing. The application is responsible for managing the memory used to return this list of highlighted entries. As such, note the following: At the minimum, the number of entries in the array should be capable of holding the number of entries indicated by the value returned from the DXmSvnGetNumHighlighted routine. If there are more entries in the array than the application will need, the SVN widget will set the value for those extra entries to 0. If the capacity of the arrays passed is less than the number of selected entries, only the number of entries allocated in the provided array (the value for len) will be returned. DXmSvnGetSelections(3X)
All times are GMT -4. The time now is 12:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy