Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Time difference between each line info.... Post 302126933 by gsp on Saturday 14th of July 2007 08:20:11 AM
Old 07-14-2007
Time difference between each line info....

Hi all,

here is a problem,

i am having a data in a file of this format,

cat filename|grep -ivn edc|tr -s ' ' +|cut -d+ f1,12

1 01:18:38 2007
25 01:43:38 2007
48 01:58:45 2007
71 02:11:02 2007
102 02:19:51 2007
and so on ........ ....... .




here 1,25,48,71,102 are the line numbers of each info

01:18:38:2007 are the timings of each info generated



here i am trying to get the time difference i.e

time difference between 1 and 25 line time difference to be printed(i.e 01:18:38:2007 - 01:43:51 2007= 00:25:13)

again time difference between 25line and 48 (i.e 01:43:51 2007-01:58:45 2007=some value)

again time difference between 48 and 71 line (i.e 01:58:45 2007-02:11:02 2007=some value)...... and so on till the End of Line in filename.



so trying to write a script .....

waiting for ur valuable suggestions till then i will be going ahead with my trails....


Summary:
i want to get the time difference between each line info.....

for further clarification kindly let me know.





Thanks in Advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Time service info

Where can i find info about the Time Service of UNIX ??? I need to "speak" with a machine which has UNIX os ( i know its IP address ) and to get from this machine its date or time. I work with Cygwin on my machine. any help will be welcomed .... (1 Reply)
Discussion started by: Inbal
1 Replies

2. UNIX for Advanced & Expert Users

Dynamic time to append for every log info

Hi All, What i am looking for: i want to generate a dynamic system time for each and every data(line) which goes on generating data continously.... now i am using this script to append a time for dynamic data generation log file, tail -f filename_error.log|awk -v var="$( date... (2 Replies)
Discussion started by: gsprasanna
2 Replies

3. Shell Programming and Scripting

Time difference

Hi, I have a tab delimited file with GMT time. How to convert the GMT to PST time and store the line only if date falls to 2 days ago date. Say today is 16, date should be of 14. or else remove the line abc - - efg - - hij - - kln - - ... (10 Replies)
Discussion started by: sandy1028
10 Replies

4. Shell Programming and Scripting

How to calculate time difference between start and end time of a process!

Hello All, I have a problem calculating the time difference between start and end timings...! the timings are given by 24hr format.. Start Date : 08/05/10 12:55 End Date : 08/09/10 06:50 above values are in mm/dd/yy hh:mm format. Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies

5. Shell Programming and Scripting

Time Difference

Is this way of finding the time difference a correct way of doing it or is it error-prone. #****Check if lastrun exist. If exists check if the difference is 1 hour or not and act accordingly*********************** if ; then lastrun_time=`cat $LOG_DIR/lastrun` curr_time=`date +%s` ... (4 Replies)
Discussion started by: sreekanthragi
4 Replies

6. Shell Programming and Scripting

Time difference between two time stamps

Hi Friends, I have 2 varaibles which contain START=`date '+ %m/%d/%y %H:%M:%S'` END=`date '+ %m/%d/%y %H:%M:%S'` i want the time difference between the two variables in Seconds. Plz help. (2 Replies)
Discussion started by: i150371485
2 Replies

7. Shell Programming and Scripting

HELP: Shell Script to read a Log file line by line and extract Info based on KEYWORDS matching

I have a LOG file which looks like this Import started at: Mon Jul 23 02:13:01 EDT 2012 Initialization completed in 2.146 seconds. -------------------------------------------------------------------------------- -- Import summary for Import item: PolicyInformation... (8 Replies)
Discussion started by: biztank
8 Replies

8. Shell Programming and Scripting

Get the time difference between two consecutive line in UNIX perl script

Hi All :o, I have some log files which contains these informations: 2013-04-24 09:11:34.018 INFO XXXXXXXXXXXX 2013-04-24 09:11:34.029 INFO YYYYYYYYYYYY 2013-04-24 09:11:34.039 INFO ZZZZZZZZZZZZZZZ 2013-04-24 09:12:21.295 INFO TTTTTTTTTTTTTTT 2013-04-24 09:12:21.489 INFO... (3 Replies)
Discussion started by: shariquehabib
3 Replies

9. Shell Programming and Scripting

Adding line in a file using info from previous line

I have a shell script that looks something like the following: mysql -uroot db1 < db1.sql mysql -uroot db2 < db2.sql mysql -uroot db3 < db3.sql mysql -uroot db4 < db4.sql .... different db names in more than 160 lines. I want to run this script with nohup and have a status later. So,... (6 Replies)
Discussion started by: MKH
6 Replies

10. Shell Programming and Scripting

Help on script to capture info on log file for a particular time frame

Hi I have a system running uname -a Linux cmovel-db01 2.6.32-38-server #83-Ubuntu SMP Wed Jan 4 11:26:59 UTC 2012 x86_64 GNU/Linux I would like to capture the contents of /var/log/syslog from 11:00AM to 11:30AM and sent to this info via email. I was thinking in set a cron entry at that... (2 Replies)
Discussion started by: fretagi
2 Replies
NetApp::Filer::Version(3pm)				User Contributed Perl Documentation			       NetApp::Filer::Version(3pm)

NAME
NetApp::Filer::Version -- OO Class for representing NetApp Filer versions SYNOPSIS
use NetApp::Filer; my $filer = NetApp::Filer->new({ ... }); # The "version" is: NetApp Release 7.2.2: Sat Mar 24 20:38:59 PDT 2007 my $version = $filer->get_version; # $version->isa("NetApp::Filer::Version") print $version->get_release, " "; # prints "7.2.2" print $version->get_date, " "; # prints "Sat Mar 24 20:38:59 PDT 2007" print $version->get_string, " "; print "$version "; # Both print the same thing, the second one through operator overloading, # namely the original, unparsed version string print $version->get_version, " "; # prints "v7.2.2" DESCRIPTION
This class is used to encapsulate the NetApp Filer version string, and provide access to the components of the string as a numeric release, a perl version, and a date string. METHODS
get_release Returns the NetApp numerical release as a string, for example: 7.2.2 get_date Returns the NetApp release date as a string, for example: Sat Mar 24 20:38:59 PDT 2007 get_string Returns the unparsed version string in it's entirety: NetApp Release 7.2.2: Sat Mar 24 20:38:59 PDT 2007 get_version Returns the NetApp release as a perl version object. perl v5.14.2 2008-11-26 NetApp::Filer::Version(3pm)
All times are GMT -4. The time now is 11:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy