![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unique sort contents of a variable | praveenbvarrier | Shell Programming and Scripting | 2 | 05-20-2008 04:12 AM |
| how to sort, and count unique data all at once? | amatuer_lee_3 | Shell Programming and Scripting | 13 | 05-15-2008 07:48 AM |
| sort function in perl | DILEEP410 | Shell Programming and Scripting | 2 | 09-14-2007 05:03 AM |
| sort and uniq in perl | reggiej | Shell Programming and Scripting | 4 | 05-18-2006 07:46 PM |
| Sort file in perl | annececile | Shell Programming and Scripting | 4 | 06-21-2002 05:52 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#15
|
|||
|
|||
|
Sorry it was typo in my code. It worked by declaring it earliar.
Thanks! |
| Forum Sponsor | ||
|
|
|
#16
|
|||
|
|||
|
One more silly doubt. How to get max value of the %list.
And if I include another field to the existing hash key, will it be composite or individual. Say I want to find max of arr[2] and need to find the unique and count of list of arr[1], is there a way to use same hash? Of its suggested to use different has variable? Thanks. |
|
#17
|
|||
|
|||
|
Quote:
Code:
@sorted = sort { $list{$a} <=> $list{$b} } keys %list;
print $sorted[-1];
|
|
#18
|
|||
|
|||
|
Thanks for your input.
Here is my requirement. I need to find max of a date field, which is in 2nd field. And I need to get Unique value of 5th field (Item no) and I need to get number of unique item in 5th field. Pls help. |
|
#19
|
|||
|
|||
|
post some lines of the data you are parsing, and show what the results are you want from those lines.
|
|
#20
|
|||
|
|||
|
Thanks for the reply.
Here is the example of the input file. Code:
26|2007-04-16|76 26|2007-04-18|81 26|2007-04-19|70 26|2007-04-20|84 26|2007-04-21|75 26|2007-04-22|57 26|2007-04-16|109 26|2007-04-18|114 26|2007-04-19|129 26|2007-04-20|157 Code:
Max Date Item No Total Count of Item 2007-04-22 109 10 2007-04-22 114 10 2007-04-22 129 10 2007-04-22 157 10 2007-04-22 57 10 2007-04-22 70 10 2007-04-22 75 10 2007-04-22 76 10 2007-04-22 81 10 2007-04-22 84 10 And Iam getting the total count like Code:
my $TotalRows = keys(%fileHash1) Thanks in advance. |
|
#21
|
|||
|
|||
|
sorry, I do not understand the results you want from the data you posted. You will need to explain better how you arrive at those results based on that input. There isn't even a 5th field in the data you posted:
Quote:
This looks wrong: $CurrentDate > $MaxDate) what is the values of $CurrentDate and $MaxDate when you try and compare them like that? |
|||
| Google The UNIX and Linux Forums |