And please notice that no sorting of the input is required, unlike awk|sort|uniq
Jared
| Mladen Gogala <mladen@wangtrading.com>
Sent by: ml-errors@fatcity.com
01/22/2004 08:54 AM
Please respond to ORACLE-L
|
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
cc:
Subject: Re: How to get unique value using AWK? |
There is much improved version of awk called "perl"
and it has something called hashes. Code snippet would
look something like this:
my %Godot;
while (<>} {
chomp;
if (/\'([^\']+)/ {
next if exists $Godot{$1};
$Godot{$1}=undef;
}
}
foreach (sort keys %Godot) {
print "$_\n";
}
On 01/22/2004 11:09:26 AM, jaysingh1@optonline.net wrote:
> Hi All,
>
> My manager wants to get all the unique wait events from the trace
> file.
> I tried the below but how do i get DISTICT wait event name?
>
> Any help would be really appreciated.
>
> $ grep -i WAIT devdb1_ora_989.trc_orig|awk '{print $3" " $4 " " $5 "
> "$6}'|more
> nam='SQL*Net message to client'
> nam='SQL*Net message from client'
> nam='library cache lock' ela=
> nam='SQL*Net message to client'
> nam='SQL*Net message from client'
> nam='SQL*Net message to client'
> nam='SQL*Net message from client'
> nam='SQL*Net message to client'
> nam='SQL*Net message from client'
> nam='SQL*Net message to client'
> nam='SQL*Net message from client'
> nam='SQL*Net message to client'
> nam='SQL*Net message from client'
> nam='SQL*Net message to client'
>
>
> Thanks
> Jay
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author:
> INET: jaysingh1@optonline.net
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Mladen Gogala
INET: mladen@wangtrading.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
INET: Jared.Still_at_radisys.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Thu Jan 22 2004 - 15:24:25 CST