How To Calculate Data


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How To Calculate Data
# 1  
Old 03-25-2007
Data How To Calculate Data

Hi All,
I want to calculate the total timing used by total users. Here "OUT" is showing that when an user logged in and "IN" timing is showing at what time user is logged out. If the corresponding IN-OUT is not matching then it consider the time from the mid-night of last day. Then Total timing of the Individual users I have to calculate. In the following data.

17:07:00 IN MAESTRO_MAIN dinda@abc
17:09:22 IN MAESTRO_MAIN dinda@abc
17:19:06 OUT MAESTRO_MAIN dinda@abc
17:21:07 IN JAGUAR_MAIN dinda@abc
17:25:44 IN MAESTRO_MAIN dinda@abc
11:39:01 OUT MAESTRO_MAIN secshard@ganga
11:40:11 IN MAESTRO_MAIN secshard@ganga
11:40:22 OUT MAESTRO_MAIN secshard@ganga
11:54:48 IN MAESTRO_MAIN secshard@ganga
11:57:27 OUT MMOD_XCLUSTER secshard@ganga
11:58:04 IN MMOD_XCLUSTER secshard@ganga
14:43:54 IN MAESTRO_MAIN rakesh@abc
14:55:32 IN JAGUAR_MAIN rakesh@abc
14:58:56 IN MAESTRO_MAIN rakesh@abc
15:06:58 IN JAGUAR_MAIN rakesh@abc
19:01:21 OUT MAESTRO_MAIN rakesh@abc
19:24:07 IN MAESTRO_MAIN rakesh@abc
19:24:20 OUT MAESTRO_MAIN rakesh@abc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to calculate date and show data

data: hostcomment { host_name=myhost01 entry_type=1 comment_id=1 source=0 persistent=1 entry_time=1415723753 expires=0 expire_time=0 author=hpsm comment_data=IM0837437472 } program { modified_host_attributes=1 modified_service_attributes=1 enable_notifications=1... (20 Replies)
Discussion started by: SkySmart
20 Replies

2. Shell Programming and Scripting

Calculate average for repeated ID within a data

I have an awk script that gives the following output: Average end-to-end transmission delay 2.7 to 5.7 is 0.635392 seconds Average end-to-end transmission delay 2.1 to 5.1 is 0.66272 seconds Average end-to-end transmission delay 2.1 to 5.1 is 0.691712 seconds Average end-to-end transmission... (4 Replies)
Discussion started by: ENG_MOHD
4 Replies

3. Programming

Help with sort and keep data record to calculate N50 in c

Input_file_1 #content_1 A #content_2 AF #content_3 AAR #content_4 ASEI #content_5 AS #content_6 ADFSFGS Rules: 1. Based on c program to calculate content of each "#". Result getting from the above Input_file_1 are 1,2,3,4,2,7; 2. Sort length on reverse order (descending order).... (5 Replies)
Discussion started by: cpp_beginner
5 Replies

4. Shell Programming and Scripting

Help with calculate total sum of same data problem

Long list of input file: AGDRE1 0.1005449050 AGDRE1 2.1005443435 AGDRE1 1.2005449050 AGDRE1 5.1005487870 AASFV3 50.456304789 AASFV3 2.3659706549 AASFV3 6.3489807860 AASFV3 3.0089890148 RTRTRS 5.6546403546 . . Desired output file: AGDRE1 8.5021829410 AASFV3 62.180245240... (2 Replies)
Discussion started by: perl_beginner
2 Replies

5. Shell Programming and Scripting

Calculate data and make it into new column using awk

Hi everyone, just some simple question... i've been using a awk script to calculate my data... i have 3 files: file a1.txt: 2 3 4 5 3 4 file a2.txt: 4 5 6 7 8 (1 Reply)
Discussion started by: yat
1 Replies

6. Shell Programming and Scripting

Calculate age of a file | calculate time difference

Hello, I'm trying to create a shell script (#!/bin/sh) which should tell me the age of a file in minutes... I have a process, which delivers me all 15 minutes a new file and I want to have a monitoring script, which sends me an email, if the present file is older than 20 minutes. To do... (10 Replies)
Discussion started by: worm
10 Replies

7. Shell Programming and Scripting

Calculate difference between consecutive data points in a column from a file

Hi, I have a file with one column data (sample below) and I am trying to write a shell script to calculate the difference between consecutive data valuse i.e Var = Ni -N(i-1) 0.3141 -3.6595 0.9171 5.2001 3.5331 3.7022 -6.1087 -5.1039 -9.8144 1.6516 -2.725 3.982 7.769 8.88 (5 Replies)
Discussion started by: malandisa
5 Replies

8. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

9. Shell Programming and Scripting

calculate the average of time series data using AWK

Hi, I have two time series data (below) merged into a file. t1 and t2 are in unit of second I want to calculate the average of V1 every second and count how many times "1" in V2 is occur within a second Input File: t1 V1 t2 V2 10.000000... (5 Replies)
Discussion started by: nica
5 Replies

10. HP-UX

calculate average of multiple line data

I have a question as below and i need to write a shell or perl script for this query:My Input file looks like below RNo Marks 12 50 15 70 18 80 12 40 13 55 18 88 13 75... (4 Replies)
Discussion started by: smacherla
4 Replies
Login or Register to Ask a Question