Sponsored Content
Top Forums Shell Programming and Scripting How to add the number of events grouped by field Post 302439016 by juelillo on Wednesday 21st of July 2010 11:19:26 AM
Old 07-21-2010
How to add the number of events grouped by field

Help i need to add to the end of the line the number of event grouped by id, my input file:

IN FILE:
ID DATE
10123 01-04-2008
10123 06-05-2008
10123 01-09-2009
10123 11-12-2009
10345 01-22-2008
10345 06-15-2008
10127 02-22-2010

OUT FILE:
ID DATE EVENT_NUMBER
10123 01-04-2008 1
10123 06-05-2008 2
10123 01-09-2009 3
10123 11-12-2009 4
10345 01-22-2008 1
10345 06-15-2008 2
10127 02-22-2010 1

Thanks in advance for your help.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

add increment field when first field changes

Hi I have a file that looks like the following: Name1 aaa bbbb Name1 ffd hhghg Name1 dffg ghhhh Name2 rtrt dfff Name2 rrtfr tgtt Name2 dsddf gfggf Name2 ffffg gfgf NAme3 fdff ghhgh Is it possible to format it so that a number... (2 Replies)
Discussion started by: azekry
2 Replies

2. UNIX for Dummies Questions & Answers

Number Grouped Rows in File

I have a file containing 750,000 records and have managed to sort them by related columns and now i'd like to add an ID number to the front of each line of the records that are grouped together. Which probably makes no sense so i have provided some example data and desired result. Given data.txt... (2 Replies)
Discussion started by: RacerX
2 Replies

3. Shell Programming and Scripting

Sorting on two fields time field and number field

Hi, I have a file that has data in it that says 00:01:48.233 1212 00:01:56.233 345 00:09:01.221 5678 00:12:23.321 93444 The file has more line than this but i just wanted to put in a snippet to ask how I would get the highest number with time stamp into another file. So from the above... (2 Replies)
Discussion started by: pat4519
2 Replies

4. Shell Programming and Scripting

Count number of occurences of a character in a field defined by the character in another field

Hello, I have a text file with n lines in the following format (9 column fields): Example: contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Discussion started by: s052866
3 Replies

5. Shell Programming and Scripting

awk field equal something, then add something to the field

Hi Everyone, a.txt a b c 1 e e e e e a b c 2 e e e e e the output is a b c 1 e e e e e a 00b c 2 e e e e e when 4th field = '2', then add '00' in the front of 2nd field value. Thanks (9 Replies)
Discussion started by: jimmy_y
9 Replies

6. Shell Programming and Scripting

Adding total of first field for each number in the second field

Dears, I need a script or command which can find the unique number from the second filed and against that number it adds the total of first field . 17215630 , 0 907043 ,1 201050 ,10 394149 ,4 1964 ,9 17215630, 0 907043 ,1 201050, 10 394149 ,4 1964 ,9 1234234, 55 23 ,100 33 ,67 ... (2 Replies)
Discussion started by: shary
2 Replies

7. 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
event_class(5)															    event_class(5)

NAME
event class file - The file that contains the declaration of an event class. DESCRIPTION
Audit events can be logically grouped into event classes. Event classes are defined in event class files. An event class file contains an event class number and a list of event numbers corresponding to audit events. All event class files must be created in the dcelocal/etc/audit/ec directory. The name of the event class file becomes the name of the event class. The recommended naming convention for event class files is: dce_server-name_class where class is a descriptive text that characterizes the event class. Event class files must be write-protected by the local operating system (that is, only administrators should have write access to these files). Audit clients read these files to maintain an event table in their address space. Optionally, an event class file can contain a SEP line. This line contains a list of prefixes of the event numbers in the file. The SEP line speeds up the scanning performed by the Audit clients. Audit clients which do not have events with one of the prefixes listed will not scan the event list. If the SEP line is not provided in the file, Audit clients will have to read the entire file to find out if the event class file contains any of their events. Empty lines are ignored in the event class file. Comments are designated by the number sign (#) placed before the comment text. The Event Class File Format The format of an event class file is: ECN=event_class_number SEP=prefix_1 prefix_2 ... # comments start with the number sign event_num- ber_1 event_number_2 EXAMPLES
Following is an example of an event class file for the event class ec_local_authentication: ECN = 0x00000001 SEP = 0x100 # AS_Request 0x00000100 # TGS_TicketReq 0x00000101 # TGS_RenewReq 0x00000102 # TGS_ValidateReq 0x00000103 event_class(5)
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy