Sponsored Content
Top Forums Shell Programming and Scripting Find time difference based on logfile Post 302936266 by Srinivas Gadi on Tuesday 24th of February 2015 09:24:22 AM
Old 02-24-2015
Hi Don,

Its my bad,
Yes you have to consider the two consecutive start and end rows treated as one block.

Code:
cat business_file
start:skdjh:22:06:2010:10:30:22
end:siifneworigo:22:06:2010:10:45:34

start:srsdneriieroi:24:06:2010:11:00:45
end:erfqefegoieg:24:06:2010:11:46:34

start:sdjfhsldf:25:07:2010:12:55:43
end:dgnoeingwoit:25:07:2010:13:42:1

I just filtered out the logfile having the rows start and end.
And the date formate is 24hrs , apologies for not being clear.

the sample output is
Code:
912 sec 
6909 sec
2789 sec

Thanks
Srini

Last edited by rbatte1; 02-25-2015 at 07:04 AM.. Reason: Added CODE tags for output
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To find the time difference between two lines of the same log file

Hello Friends, I want to write a script for the following: nlscux62:tibprod> grep "2008 Apr 30 01:" SA_EHV_SPEED_SFC_IN_03-SA_EHV_SPEED_SFC_IN_03-2.log | grep -i post | more 2008 Apr 30 01:01:23:928 GMT +2 SAPAdapter.SA_EHV_SPEED_SFC_IN_03-SA_EHV_SPEED_SFC_IN_03-2 Info AER3-000095 IDOC... (2 Replies)
Discussion started by: satyakam
2 Replies

2. Shell Programming and Scripting

Help to find the time difference between the lines

Hi guru's, Am new to shell scripting. I am getting the below o/p from the oracle database, when I fire a query. ID JOB_ID ELAPSED_TIME FROM TO ----- ------ ------------------- -------- -------- 62663 11773 01/06/2009 09:49:13 SA CM 62664 11773 ... (4 Replies)
Discussion started by: sathik
4 Replies

3. AIX

How to find time difference between 2 timestamps?

HI All, can some one please help me how to fine the difference between two time stamps say a= Nov 10, 2009 9:21:25 AM b= Nov 10, 2009 10:21:25 AM I want to find difference between the a & b I googled and tried with some options but no luck. My OS is AIX (1 Reply)
Discussion started by: bandlan9
1 Replies

4. Shell Programming and Scripting

Find Time difference in Unix

Hi, START_TIME :- "10-NOV-2009 00:00:04" STOP_TIME :- "10-NOV-2009 00:05:47" Please help to find difference between these two. Searched for the same topic but did not find an answer for the same time format :( Regards, Robin (3 Replies)
Discussion started by: robinbannis
3 Replies

5. Shell Programming and Scripting

Find time difference between two consecutive lines in same file.

Hello I have a file in following format: IV 08:09:07 NM 08:12:01 IC 08:12:00 MN 08:14:20 NM 08:14:15 I need a script to compare time on each line with previous line and show the inconsecutive line. Ex.: 08:12:00 08:14:15 A better way... (6 Replies)
Discussion started by: vilibit
6 Replies

6. Shell Programming and Scripting

How to find time difference?

I have a file wich contains time formats and i need to get the time difference TIME1 TIME2 ================================== 20120624192555.6Z 20120624204006.5Z which means first date 2012/6/24 19:25:55,second date 2012/6/24 20:40:06 so when i get the time... (1 Reply)
Discussion started by: wnaguib
1 Replies

7. UNIX for Dummies Questions & Answers

Find time difference

I have a file wich contains time formats and i need to get the time difference TIME1 TIME2 =============== =================== 20120624192555.6Z 20120624204006.5Z which means first date 2012/6/24 19:25:55,second date 2012/6/24 20:40:06 so when i get the time... (23 Replies)
Discussion started by: wnaguib
23 Replies

8. Shell Programming and Scripting

Transpose timestamp based on column values and calculate time difference

Hello Expert, I need to transpose Date-Timestamp based on same column values and calculate time difference. The input file would be as below and required output is mentioned in the bottom INPUT File ======== 08/23/2012 12:36:09 JOB_5340 08/23/2012 12:36:14 JOB_5340 08/23/2012... (2 Replies)
Discussion started by: asnandhakumar
2 Replies

9. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies

10. UNIX for Beginners Questions & Answers

In HP-UX how to find the date time difference ?

Hello, In HP-UX how to find the date time difference ? Start time: 28-APR-2019 21:36:01 End time : 29-APR-2019 00:36:04 ---------------------- Difference is ---------------------- Much appreciate any pointer or view on this. ... (3 Replies)
Discussion started by: Siva SQL
3 Replies
Graphics::Primitive::Path(3pm)				User Contributed Perl Documentation			    Graphics::Primitive::Path(3pm)

NAME
Graphics::Primitive::Path - Collection of primitives DESCRIPTION
Graphics::Primitive::Path is a shape defined by a list of primitives. SYNOPSIS
use Graphics::Primitive::Path; my $path = Graphics::Primitive::Path->new(); $path->add_primitive($line); $path->move_to($point); METHODS
Constructor new Creates a new Graphics::Primitive::Path Instance Methods add_primitive ($prim) Add a primitive to this Path. arc ($radius, $start, $end, [ $skip_line_to ]) $path->arc($radius, $start_angle_in_radians, $end_angle_in_radians); Draw an arc based at the current point with the given radius from the given start angle to the given end angle. A line will be drawn from the current_point to the start point of the described arc. If you do not want this to happen, supply a true value as the last argument. clear_current_point Clears the current point on this Path. clear_primitives Clears all primitives from this Path. NOTE: This does not clear the current point. close_path Close the current path by drawing a line from the current_point back to the first point in the path. contiguous Flag this path as being contiguous at this point. Continuity is important so some path-based drivers such as Cairo. You should not mess with this attribute unless you know what you are doing. It's used for driver hinting. current_point Returns the current -- or last -- point on this Path. curve_to ($control1, $control2, $end) Creates a cubic BA~Xzier curve from the current point to the $end point using $control1 and $control2 as control points. ellipse ($width, $height, [ $skip_line_to ]) Creates an ellipse at the current point with the specified width and height. Optional last argument, if true, skips drawing a line to the ellipse's starting point. get_points Get this path as a series of points. get_primitive Returns the primitive at the specified offset. hints List of hint hashrefs. This hint arrayref matches the primitives arrayref one-to-one. Hints are tidbits of information that may assist drivers in optimizing (or successfully handling) primitives in this path's list. You should not mess with this structure unless you know what you are doing. line_to ($point | $x, $y) Draw a line from the current point to the one provided. Accepts either a Geoemetry::Primitive::Point or two arguments for x and y. move_to ($point | $x, $y) Move the current point to the one specified. This will not add any primitives to the path. Accepts either a Geoemetry::Primitive::Point or two arguments for x and y. primitive_count Returns the number of primitives on this Path. rectangle ($width, $height) Draw a rectangle at current_position of the specified width and height. rel_curve_to ($x1, $y1, $x2, $y2, $x3, $y3) Creates a cubic BA~Xzier curve from the current point using the provided values as offsets: start = current point control1 = current point + $x1,$y1 control1 = current point + $x2,$y2 end = current point + $x3,$y3 rel_line_to ($x_amount, $y_amount) Draw a line by adding the supplied x and y values to the current one. For example if the current point is 5,5 then calling rel_line_to(2, 2) would draw a line from the current point to 7,7. rel_move_to ($x_amount, $y_amount) Move to a new point by adding the supplied x and y values to the current ones. AUTHOR
Cory Watson <gphat@cpan.org> COPYRIGHT &; LICENSE Copyright 2008-2010 by Cory G Watson. You can redistribute and/or modify this code under the same terms as Perl itself. perl v5.12.3 2010-08-21 Graphics::Primitive::Path(3pm)
All times are GMT -4. The time now is 09:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy