Sponsored Content
Top Forums Shell Programming and Scripting Need help looking for missing hours. Post 302817319 by RudiC on Wednesday 5th of June 2013 03:35:26 PM
Old 06-05-2013
You might want to try
Code:
awk     '/DMME/ {ACT=substr($0,11,4)
                 if (ACT - EXP) print EXP
                 CNT += .25
                 EXP  = sprintf ("%04d", int(CNT)*100 + (CNT - int(CNT))*60)
                }
         END    {for (CNT; CNT<24; CNT+=.25) printf ("%04d\n", int(CNT)*100 + (CNT - int(CNT))*60)
                }
        ' file

---------- Post updated at 21:35 ---------- Previous update was at 20:48 ----------

Don't! It does not synchronize well once a line/time is lost. Try this:
Code:
awk     'BEGIN  {for (CNT=0; CNT<24; CNT+=.25) Arr[sprintf ("%04d", int(CNT)*100 + (CNT - int(CNT))*60)]}
         /DMME/ {delete Arr[substr($0,11,4)]}
         END    {for (i in Arr) print i}
        ' file

Pipe the result through sort | sort if you need the item in ascending sequence.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Have we just had a rollback of a few hours?

Have we just had a rollback of a few hours? (1 Reply)
Discussion started by: porter
1 Replies

2. Shell Programming and Scripting

how to list files between last 6 hours to 3 hours

Hi Frens, I want to list some files from a directory, which contains "DONE" in their name, i am receiving files every minute. In this i want to list all the files which are newer than 6 hours but older than 3 hours, of current time i dont want my list to contain the latest files which are ... (4 Replies)
Discussion started by: Prat007
4 Replies

3. What is on Your Mind?

How Many hours on Computer?

How many hours you spend on Computer in a day??? (10 Replies)
Discussion started by: malcomex999
10 Replies

4. Shell Programming and Scripting

CurrentTime-4 hours

Hi, Good Afternoon! I am writing this script on "sh" and have Variables as below. #Time in hours ex: 09 JobTime=`echo $StartTime |awk '{print $2}'|cut -f1 -d':'` SystemHours=`date +%H` How can go 4 hours back for each variable in a day? Another Question? JobStat=`dsjob -report... (5 Replies)
Discussion started by: rajubollas
5 Replies

5. AIX

cron off by 5 hours

stupid question im sure, but its frustrating My cron jobs are off by 5 hours. My system time is right but all of my cron jobs are running approximately 5 hours late. Any idea why? (4 Replies)
Discussion started by: mshilling
4 Replies

6. Shell Programming and Scripting

ps -ef |grep 24 hours

I need to grep PIDs older than 24 hours (1 day) or more. ps -ef |grep ??? Please advise. (10 Replies)
Discussion started by: Daniel Gate
10 Replies

7. Shell Programming and Scripting

Get the no of hours between days

Hi, i have a date 1- 2013101511 date2 -2013101812 need toget the no of hours between them,can any one tellme the logic. (6 Replies)
Discussion started by: sandeep karna
6 Replies

8. SuSE

How to resolve missing missing dependencies with opensuse 11.3 and 12.3?

Hello, This is a programming question as well as a suse question, so let me know if you think I should post this in programming. I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

9. Red Hat

Yum - resolving missing dependencies that are not missing

I am trying to install VirtualBox on RHEL 5 but I need the 32 bit version for 32 bit Windows. When I run yum I get the following: sudo yum localinstall /auto/spvtg-it/spvss-migration/Software/VirtualBox-4.3-4.3.2_90405_el6-1.i686.rpm Loaded plugins: fastestmirror Setting up Local Package... (13 Replies)
Discussion started by: gw1500se
13 Replies

10. UNIX for Beginners Questions & Answers

Fill in missing hours and interpolate values using awk.

I have a time series data like this 40754,35.6931,51.3092,201610160700,21.0 40754,35.6931,51.3092,201610160800,23.0 40754,35.6931,51.3092,201610160900,24.0 40754,35.6931,51.3092,201610161000,24.0 40754,35.6931,51.3092,201610161300,25.0 40754,35.6931,51.3092,201610161400,23.0... (6 Replies)
Discussion started by: emirzaei
6 Replies
EXP(3)							     Linux Programmer's Manual							    EXP(3)

NAME
exp, expf, expl - base-e exponential function SYNOPSIS
#include <math.h> double exp(double x); float expf(float x); long double expl(long double x); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): expf(), expl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99 DESCRIPTION
The exp() function returns the value of e (the base of natural logarithms) raised to the power of x. RETURN VALUE
On success, these functions return the exponential value of x. If x is a NaN, a NaN is returned. If x is positive infinity, positive infinity is returned. If x is negative infinity, +0 is returned. If the result underflows, a range error occurs, and zero is returned. If the result overflows, a range error occurs, and the functions return +HUGE_VAL, +HUGE_VALF, or +HUGE_VALL, respectively. ERRORS
See math_error(7) for information on how to determine whether an error has occurred when calling these functions. The following errors can occur: Range error, overflow errno is set to ERANGE. An overflow floating-point exception (FE_OVERFLOW) is raised. Range error, underflow errno is set to ERANGE. An underflow floating-point exception (FE_UNDERFLOW) is raised. CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4, 4.3BSD, C89. SEE ALSO
cbrt(3), cexp(3), exp10(3), exp2(3), sqrt(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-05 EXP(3)
All times are GMT -4. The time now is 12:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy