Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Print events from two lines with a common identifier Post 302824525 by vanand420 on Friday 21st of June 2013 04:32:25 AM
Old 06-21-2013
Print events from two lines with a common identifier

Hi Unix Gurus,

I have a long text file, where alarms events are logged and alarm clear event are logged.

Both events alarm and alarm clear has common identifier as{xxxxxxxxxx}

I need to analyse the time-period for which the alarm sustained.

i.e

Output: timestamp from both event has been captured.
Code:
alarm;  pcm;     communications; major;  2013-06-21 03:23:00; 2013-06-21 03:23:03;    {1006905493};

Input File:
Code:
alarm;  pcm;     communications; major;  2013-06-21 03:23:00;     {1006905493};   '2.2.2.1-pcmBlock-X';
clearAlarm;     pcm;     communications; major;  2013-06-21 03:23:03;     {1006905493};   autoclear;
alarm;  pcm;     communications; major;  2013-06-21 03:23:04;     {1006905494};   '2.2.2.1-pcmBlock-X';
clearAlarm;     pcm;     communications; major;  2013-06-21 03:23:09;     {1006905494};   autoclear;

Thanks in advance..
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

COMMON_ROOT=/files/common: is not an identifier

hi, i am getting this error while executing the script with cron:- COMMON_ROOT=/files/common: is not an identifier Manual run is ok, not getting any error. (2 Replies)
Discussion started by: nitinmoriwal
2 Replies

2. UNIX for Advanced & Expert Users

how to take out common of two lines in a file

I use sed and awk. I am not a big expert but to some extent. I have file like this PFA0165c ctg_6843 PFA0335w ctg_6843 ctg_6871 ctg_6977 ctg_6654 ctg_7052 ctg_6899 ctg_6840 ctg_7202 ctg_6638 PFA0155c ctg_6877 ctg_7169 ctg_7179 ctg_6843 ctg_6871 Now I want output like... (6 Replies)
Discussion started by: jam_ali49
6 Replies

3. Shell Programming and Scripting

Common lines from files

Hello guys, I need a script to get the common lines from two files with a criteria that if the first two columns match then I keep the maximum value of the 3rd column.(tab separated columns) Sample input: file1: 111 222 0.1 333 444 0.5 555 666 0.4 file 2: 111 222 0.7 555 666... (5 Replies)
Discussion started by: jaysean
5 Replies

4. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

5. Shell Programming and Scripting

Common lines from files

Hello guys, I need a script to get the common lines from two files with a criteria that if the first two columns match then I keep the maximum value of the 5th column.(tab separated columns) . 3rd and 4th columns corresponds to the row which has highest value for the 5th column. Sample... (2 Replies)
Discussion started by: jaysean
2 Replies

6. Shell Programming and Scripting

Find common numbers and print yes or no

Hi I have 2 files with following data First file, sp|Q676U5|A16L1_HUMAN, Autophagy-related protein 16-1 OS=Homo sapiens GN=ATG16L1 PE=1 SV=2, Maximum coiled-coil residue probability: 0.657 in position 163. Maximum dimeric residue probability: 0.288 in position 163. ... (1 Reply)
Discussion started by: manigrover
1 Replies

7. Shell Programming and Scripting

Sum column values based in common identifier in 1st column.

Hi, I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column) The input is for example, after sorted: K00001 1 1 4 3... (8 Replies)
Discussion started by: sargotrons
8 Replies

8. UNIX for Beginners Questions & Answers

Compare two files and print based on common variable value.

Hi All, i have below two files. FILE: NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root" GROUP="disk" MODE="brw-rw----" PKNAME="" MOUNTPOINT="" NAME="/dev/sda1" TYPE="part" SIZE="500M" OWNER="root" GROUP="disk" MODE="brw-rw----" PKNAME="/dev/sda" MOUNTPOINT="/boot" NAME="/dev/sda2"... (3 Replies)
Discussion started by: balu1234
3 Replies
LSDAHDI(8)						User Contributed Perl Documentation						LSDAHDI(8)

NAME
lsdahdi - List all dahdi channels with their types and spans. SYNOPSIS
lsdahdi DESCRIPTION
Example output: ### Span 1: WCTDM/0 "Wildcard TDM400P REV E/F Board 1" 1 FXO FXOLS (In use) 2 FXS FXSKS 3 FXS FXSKS 4 FXS FXSKS ### Span 2: XBUS-00/XPD-00 "Xorcom XPD #00/00: FXO" 5 FXO FXSKS (In use) 6 FXO FXSKS (In use) (no pcm) 7 FXO FXSKS (In use) (no pcm) 8 FXO FXSKS (In use) (no pcm) 9 FXO FXSKS (In use) (no pcm) 10 FXO FXSKS (In use) (no pcm) 11 FXO FXSKS (In use) (no pcm) 12 FXO FXSKS (In use) (no pcm) ### Span 3: XBUS-00/XPD-10 "Xorcom XPD #00/10: FXO" 13 FXO FXSKS (In use) (no pcm) 14 FXO FXSKS (In use) (no pcm) 15 FXO FXSKS (In use) (no pcm) 16 FXO FXSKS (In use) (no pcm) 17 FXO FXSKS (In use) (no pcm) 18 FXO FXSKS (In use) (no pcm) 19 FXO FXSKS (In use) (no pcm) 20 FXO FXSKS (In use) (no pcm) ... ### Span 6: XBUS-01/XPD-00 "Xorcom XPD #01/00: FXS" 37 FXS FXOLS (In use) 38 FXS FXOLS (In use) (no pcm) 39 FXS FXOLS (In use) (no pcm) 40 FXS FXOLS (In use) (no pcm) 41 FXS FXOLS (In use) (no pcm) 42 FXS FXOLS (In use) (no pcm) 43 FXS FXOLS (In use) (no pcm) 44 FXS FXOLS (In use) (no pcm) 45 Output FXOLS (In use) (no pcm) 46 Output FXOLS (In use) (no pcm) 47 Input FXOLS (In use) (no pcm) 48 Input FXOLS (In use) (no pcm) 49 Input FXOLS (In use) (no pcm) 50 Input FXOLS (In use) (no pcm) The first column is the type of the channel (port, for an analog device) and the second one is the signalling (if set). FILES
lsdahdi is a somewhat glorified 'cat /proc/dahdi/*' . Unlike that command, it sorts the spans with the proper order. It also formats the output slightly differently. perl v5.14.2 2010-03-03 LSDAHDI(8)
All times are GMT -4. The time now is 11:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy