Sponsored Content
Top Forums UNIX for Advanced & Expert Users Want to get average value for each hour Post 302940310 by mjf on Friday 3rd of April 2015 06:40:21 AM
Old 04-03-2015
Don,
Yes, I added another test record with 3/3/2015 date to test the break logic and forgot to remove it from posted output (as OP did not include it in his file). I missed the semi-colon although I'm not clear at the moment why it impacted the output (the extra decimal places). Thanks for pointing this out.
This User Gave Thanks to mjf For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

1 Hour less

set DAY=`date +%y%m%d` set H=`date +%H` set M=`date +%M` mailx -s "$H-Mydata" myemail@mail.com<mydata I am looking to set the current hour to have 1 hour less in the subject header: For example: let's say the system time is 8 I want to have "7-Mydata" not "8-Mydata" Can some1... (6 Replies)
Discussion started by: bobo
6 Replies

2. UNIX for Dummies Questions & Answers

an hour less in 24 hour system

My program: __________________________________ #!/bin/ksh DAY=`date +%y%m%d` H=`date +%H` M=`date +%M` day=`date +%m/%d/%y` let h=$H-1 echo DAY $DAY echo H $H echo M $M echo day $day echo h $h _____________________________________ My result: (3 Replies)
Discussion started by: bobo
3 Replies

3. Shell Programming and Scripting

help in hour grep

i have this script that checks for yesterday date and also specific hour in that ----------------------------------------------------------------- TZ=`date +%Z`+24 ;a=`date +%Y-%m-%d %k` cd logs count=0 for i in DBMaint.log do cat $i | grep $a >> file12.txt done... (0 Replies)
Discussion started by: ali560045
0 Replies

4. Shell Programming and Scripting

Counting average data per hour

Hi i have log like this : Actually i will process the data become Anybody can help me ? (6 Replies)
Discussion started by: justbow
6 Replies

5. What is on Your Mind?

Power Hour?

I had some free time at work today so I decided to get a little practice with my shell scripts (I'm pretty new to the whole UNIX thing). I'm sure I'm not the only college student here so maybe this code will come in handy for future weekends. #!/bin/sh if then echo "No playlist... (0 Replies)
Discussion started by: thedoobieman5
0 Replies

6. Shell Programming and Scripting

Getting the last hour from a log.

I have a log like this: Jan 26 13:59:41 server2 ntpdate: step time server 91.189.94.4 offset 0.065456 sec Jan 26 13:59:41 server2 ntpd: ntpd 4.2.4p8@1.1612-o Fri Aug 6 22:49:54 UTC 2010 (1) Jan 26 13:59:41 server2 ntpd: precision = 1.000 usec Jan 26 13:59:41 server2 ntpd: ntp_io: estimated max... (2 Replies)
Discussion started by: Jotne
2 Replies

7. UNIX for Dummies Questions & Answers

Load average spikes once an hour

Hi, I am getting a high load average, around 7, once an hour. It last for about 4 minutes and makes things fairly unusable for this time. How do I find out what is using this. Looking at top the only thing running at the time is md5sum. I have looked at the crontab and there is nothing... (10 Replies)
Discussion started by: sm9ai
10 Replies

8. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

9. Shell Programming and Scripting

How to get next hour?

Hi guys I want any script to get me next hour For example Nexthour.sh 2013022823 It get me result 2013030100 Thanks a lot , I'm using Solaris 10 (5 Replies)
Discussion started by: teefa
5 Replies

10. Shell Programming and Scripting

Average of multiple time-stamped data every half hour

Hi All, Thank you for reading through my post and helping me figure out how I would be able to perform this task. For example: I have a list of continuous output collected into a file in the format as seen below: Date...........Time........C....A......... B ==========================... (5 Replies)
Discussion started by: terrychen
5 Replies
DBASE_REPLACE_RECORD(3) 						 1						   DBASE_REPLACE_RECORD(3)

dbase_replace_record - Replaces a record in a database

SYNOPSIS
bool dbase_replace_record (int $dbase_identifier, array $record, int $record_number) DESCRIPTION
Replaces the given record in the database with the given data. PARAMETERS
o $dbase_identifier - The database link identifier, returned by dbase_open(3) or dbase_create(3). o $record - An indexed array of data. The number of items must be equal to the number of fields in the database, otherwise dbase_replace_record(3) will fail. Note If you're using dbase_get_record(3) return value for this parameter, remember to reset the key named deleted. o $record_number - An integer which spans from 1 to the number of records in the database (as returned by dbase_numrecords(3)). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Updating a record in the database <?php // open in read-write mode $db = dbase_open('/tmp/test.dbf', 2); if ($db) { // gets the old row $row = dbase_get_record_with_names($db, 1); // remove the 'deleted' entry unset($row['deleted']); // Update the date field with the current timestamp $row['date'] = date('Ymd'); // Replace the record dbase_replace_record($db, $row, 1); dbase_close($db); } ?> SEE ALSO
dbase_add_record(3), dbase_delete_record(3). PHP Documentation Group DBASE_REPLACE_RECORD(3)
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy