I want to find the top N entries for a certain field based on the values of another field.
For example if N=3, we want the 3 best values for each entry:
Entry1 ||| 100
Entry1 ||| 95
Entry1 ||| 30
Entry1 ||| 80
Entry1 ||| 50
Entry2 ||| 40
Entry2 ||| 20
Entry2 ||| 10
Entry2 ||| 50... (1 Reply)
Say the input was as follows:
Brat 20 x 1000 32rf
Pour 15 p 1621 05pr
Dart 10 z 1111 22xx
My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour"
I currently have this line but it is... (6 Replies)
It seems like a common task, but I haven't been able to find the solution.
vitallog.txt
1310,John,Hancock
13211,Steven,Mills
122,Jane,Doe
138,Thoms,Doe
1500,Micheal,May
vitalinfo.txt
12122,Jane,Thomas
122,Janes,Does
123,Paul,Kite
**OUTPUT**
vitalfiltered.txt
12122,Jane,Thomas... (2 Replies)
I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work.
Brief overview:
I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
I am trying to find a specific set of characters in a long file. I only want to find the characters in column 265 for 4 bytes.
Is there a search for that? I tried cut but couldn't get it to work.
Ex. I want to find '9999' in column 265 for 4 bytes. If it is in there, I want it to print... (12 Replies)
Hi everyone,
I am trying to find sty all day.
I have two files:
File 1:
N 82 AAA A 1 0.67
N 83 BBB B 1 0.79
N 84 CCC C 1 0.11
File 2:
N 82 AAA A 1 0.63
N 83 BBB B 1 0.03
N 84 CCC C 1 0.08
I want to calculate... (2 Replies)
I have a file that has multiple lines, of grouped data, that typically all have the same values in the 1st field, however, I would like to search the 1st field for any differences and set a flag to use in an "if" statement to run some other routine.
An example of the typical file is below,... (2 Replies)
Hello,
i need help with awk.
I have this file:
cat number
DirB port 67 er_enc_out 0 er_bad_os 0
DirB port 71 er_enc_out 56 er_bad_os 0
DirB port 74 er_enc_out 0 er_bad_os 0
DirB port 75 ... (4 Replies)
Hi ,
I have a requirement to read a file ( 5 fields , ~ delimited) and find the records which contain anything other than Alphabets, Numbers , comma ,space and dot . ie a-z and A-Z and 0-9 and . and " " and , in 2nd field. Once I do that i would want the result to have field1|<flag>
flag can... (2 Replies)
Discussion started by: ashwin3086
2 Replies
LEARN ABOUT OPENSOLARIS
cpc_event_accum
cpc_event_diff(3CPC) CPU Performance Counters Library Functions cpc_event_diff(3CPC)NAME
cpc_event_diff, cpc_event_accum - simple difference and accumulate operations
SYNOPSIS
cc [ flag... ] file... -lcpc [ library... ]
#include <libcpc.h>
void cpc_event_accum(cpc_event_t *accum, cpc_event_t *event);
void cpc_event_diff(cpc_event_t *diff, cpc_event_t *after,
cpc_event_t *before);
DESCRIPTION
The cpc_event_accum() and cpc_event_diff() functions perform common accumulate and difference operations on cpc_event(3CPC) data struc-
tures. Use of these functions increases program portability, since structure members are not referenced directly .
cpc_event_accum()
The cpc_event_accum() function adds the ce_pic fields of event into the corresponding fields of accum. The ce_hrt field of accum is set to
the later of the times in event and accum.
SPARC:
The function adds the contents of the ce_tick field of event into the corresponding field of accum.
x86:
The function adds the contents of the ce_tsc field of event into the corresponding field of accum.
cpc_event_diff()
The cpc_event_diff() function places the difference between the ce_pic fields of after and before and places them in the corresponding
field of diff. The ce_hrt field of diff is set to the ce_hrt field of after.
SPARC:
Additionally, the function computes the difference between the ce_tick fields of after and before, and places it in the corresponding field
of diff.
x86:
Additionally, the function computes the difference between the ce_tsc fields of after and before, and places it in the corresponding field
of diff.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Obsolete |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO cpc(3CPC), cpc_buf_add(3CPC), cpc_buf_sub(3CPC), cpc_event(3CPC), libcpc(3LIB), attributes(5)NOTES
The cpc_event_accum() and cpc_event_diff() functions exist for binary compatibility only. Source containing these functions will not com-
pile. These functions are obsolete and might be removed in a future release. Applications should use cpc_buf_add(3CPC) and
cpc_buf_sub(3CPC) instead.
SunOS 5.11 28 Mar 2005 cpc_event_diff(3CPC)