Sponsored Content
Top Forums Shell Programming and Scripting Sorting value frequency within an array Post 302378905 by dennis.jacob on Wednesday 9th of December 2009 04:59:24 AM
Old 12-09-2009
If "file" contains the values..

Code:
gawk 'A[$0]++ && (A[$0] > max) { max=A[$0]; _=$0} END { print _; }' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Sorting an associative array

Hi, When using sort on an associative array: foreach $key (sort(keys(%opalfabet))){ $value = $opalfabet{$key}; $result .= $value; } How does it handle double values? It seems to me that it removes them, is that true? If so, is there a way to get... (2 Replies)
Discussion started by: tine
2 Replies

2. Shell Programming and Scripting

sorting data using array in ksh

plz help me..........i have a ksh script that sorts data in ascending order. the 1st half is correct,but for the line no 31 its showing problem 1 #!/bin/ksh 2 3 4 5 echo "Enter the array length" 6 read num 7 8 9 echo "enter the... (4 Replies)
Discussion started by: ali560045
4 Replies

3. Shell Programming and Scripting

Sorting Awk generalized array

Generalized arrays take any type of variable(s) as subscripts, but the subscript(s) are treated as one long string expression. The use of for(a in x) on a generalized array will return all of the valid subscripts in some order, not necessarily the one you wished. How can I make it so that i... (2 Replies)
Discussion started by: gio001
2 Replies

4. Shell Programming and Scripting

perl array sorting

Hi All, I have an array in perl as @match = (201001,201002,201001,201002); I am trying to sort this array as @match = sort(@match); print "@match"; I dont see the output sorted any answers I also tried another way, but still the results are not sorted foreach my $match (sort { $a... (2 Replies)
Discussion started by: bsdeepu
2 Replies

5. Shell Programming and Scripting

sorting numeric array

Hi, I would like to do the following sorting, but the output is not what i expected. Why 222 and 2222 are not at the last two elements of array? awk 'BEGIN{a="22";a="2222";a="33";a="44";a="222";a="11";a="22";a="33";asort(a); for (i=1;i<=8;i++) print a}' 11 22 22 222 2222 33 33 44... (1 Reply)
Discussion started by: phoeberunner
1 Replies

6. Shell Programming and Scripting

sorting multi dimensional array

Hi there, Can someone let me know how to sort the 2 dimensional array below by column 1 then by column 2? 22 55 2222 2230 33 66 44 58 222 240 11 25 22 60 33 45 output: 11 25 22 55 22 60 33 45 33 66 44 58 (6 Replies)
Discussion started by: phoeberunner
6 Replies

7. Shell Programming and Scripting

[Perl] Sorting an String-Array

Hi, i have a txtfile with the format <Nr>tab<word>tab<other stuff>new line and i want to sort the <word>-colum with a perl script. My textfile: <Nr>tab<word>tab<other stuff>new line 6807 die ART.Acc.Sg.Fem 6426 der ART.Gen.Sg.Fem 2 die ART.Nom.Sg.Fem 87 auf APPR.-- 486 nicht PTKNEG.--... (1 Reply)
Discussion started by: buckelede
1 Replies

8. Shell Programming and Scripting

Sorting awk array output?

Hi all, I have a script which produces a nice table but I want to sort it on column 3. This is the output line in the script: # Output { FS = ":"; format = "%11s %6s %-16s\n"; prinft "\n" printf ( format, "Size","Count","Who" ) } for (i in... (21 Replies)
Discussion started by: Cowardly
21 Replies

9. Shell Programming and Scripting

Sorting output of AWK array

I need help to sort the output of an awk array Example datadata="1 blue 2 green 3 blue 4 yellow 5 blue 6 red 7 yellow 8 red 9 yellow 10 yellow 11 green 12 orange 13 black" My awk line to get output in one lineecho "$data" | awk ' {arr++; next} END { for (i in arr) { if(arr>1 )... (2 Replies)
Discussion started by: Jotne
2 Replies

10. Shell Programming and Scripting

Sorting a file with frequency on length

Hello, I have a file which has the following structure word space Frequency The file is around 30,000 headwords each along with its frequency. The words have different lengths. What I need is a PERL or AWK script which can sort the file on length of the headword and once the file is sorted on... (12 Replies)
Discussion started by: gimley
12 Replies
CISS(4) 						   BSD Kernel Interfaces Manual 						   CISS(4)

NAME
ciss -- HP/Compaq Smart ARRAY 5/6 RAID controllers SYNOPSIS
ciss* at pci? function ? DESCRIPTION
The ciss driver provides support for the CISS interface implemented by fifth and later generations of the HP/Compaq Smart ARRAY family of controllers. The CISS interface is defined in the document entitled CISS Command Interface for SCSI-3 Support Open Specification, Version 1.04, Valence Number 1, Compaq Computer Corporation, 2000/11/27. This driver supports several Compaq and HP controllers implementing the CISS interface, including: o Compaq Smart Array 5300 version 1 o Compaq Smart Array 5300 version 2 o Compaq Smart Array 5i version 1 o Compaq Smart Array 5i version 2 o HP Smart Array 5312 o HP Smart Array 6i o HP Smart Array 641 o HP Smart Array 642 o HP Smart Array 6400 o HP Smart Array 6400 EM o HP Smart Array E200 o HP Smart Array E200i o HP Smart Array P400 o HP Smart Array P400i o HP Smart Array P600 o HP Smart Array P800 o HP Smart Array V100 o HP Smart Array 1 through 13 These controllers support RAID 0, RAID 1, RAID 5, JBOD, and superpositions of those configurations. Although the controllers are actual RAID controllers, the ciss driver makes them look just like SCSI controllers. All RAID configuration must be done through the controllers' BIOSes. Hardware from previous generations of this product family may be supported by the cac(4) driver. SEE ALSO
bio(4), cac(4), intro(4), pci(4), scsi(4), sd(4) HISTORY
The ciss driver first appeared in NetBSD 3.1. AUTHORS
The ciss driver was written by Michael Shalayeff <mickey@openbsd.org>, and ported to NetBSD by Tonnerre Lombard <tonnerre@netbsd.org>. BSD
May 28, 2008 BSD
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy