Sponsored Content
Full Discussion: Awk script to add times.
Top Forums Shell Programming and Scripting Awk script to add times. Post 302192383 by Annihilannic on Tuesday 6th of May 2008 08:17:18 PM
Old 05-06-2008
I presume you want to display cumulative times for each user? Try using the split() function to pull out the components of the time field, and convert it to minutes, and add it to time[$1]. Then convert it back to d+hh:mm format when you are ready to print it.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK print a character many times

How can I print a '-' on the same line within awk, say 50 times, without actually typing '-' 50 times? Cheers (3 Replies)
Discussion started by: dbrundrett
3 Replies

2. Shell Programming and Scripting

Add missing times

Not sure about the title if someone has a better name for it please lemme know and I will edit the title. I have several (10+ files) which look something like: File 1: 12/28/2009 04:0 8 12/28/2009 04:4 4 12/28/2009 05:0 4 . . . File 2: 12/28/2009 04:1 7 12/28/2009 04:2 3... (2 Replies)
Discussion started by: jstrangfeld
2 Replies

3. Shell Programming and Scripting

Reading a file several times with awk

Hi everyone, I was wondering if it's possible to read a file ("file2" in my example) more than once. In this example I want to print file2 entirely for each lines of file1: awk -F$'\t' '{ print $0 while ((getline < "file2") > 0) { print "\t"$0 } }' file1 It... (4 Replies)
Discussion started by: anthony.cros
4 Replies

4. Shell Programming and Scripting

How to make AWK process an input file many many times?

By "many many times" I mean the times the input file is to be processed is unknown beforehand, it will be known when awk finishes processing the input file for the first time. So my question is: how to start over again from the first record of the input file when AWK finishes processing the... (7 Replies)
Discussion started by: kevintse
7 Replies

5. Shell Programming and Scripting

awk - find average interarrival times for each unique page

All, I have a test file as specified below. 1st col is <arrival time> and 2nd col is <Page #>. I want to find the inter-arrival time of requests for each page # (I've done this part already). Once I have this, I want to calculate the average interarrival time. Note, that I am trying to have the... (11 Replies)
Discussion started by: jontjioe
11 Replies

6. Shell Programming and Scripting

AWK Duplicate lines multiple times based on a calculated value

Hi, I'm trying to create an XML sitemap of our dynamic ecommerce sites SEO Friendly URLs and am trying to create the initial page listing. I have a CSV file that looks like the following and need duplicate the lines based on a value which needs calculating. ... (2 Replies)
Discussion started by: jamesfx
2 Replies

7. Programming

Problem with implementing the times() function in C (struct tms times return zero/negative values)

Hello, i'm trying to implement the times() function and i'm programming in C. I'm using the "struct tms" structure which consists of the fields: The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process. The tms_stime structure... (1 Reply)
Discussion started by: g_p
1 Replies

8. Shell Programming and Scripting

Sed or Awk for lines between two strings multiple times and keep the last one

Hi, I am trying to get lines between the last occurrences of two patterns. I have files that have several occurrences of “Standard” and “Visual”. I will like to get the lines between “Standard” and “Visual” but I only want to retain only the last one e.g. Standard Some words Some words Some... (4 Replies)
Discussion started by: damanidada
4 Replies

9. Shell Programming and Scripting

sed add space X times

Pattern: Mary walks at the park every day with her children sed 's/$/ /' will make it add 1 space at the end (trailing) I want to add X ($VARIABLE) number of spaces (which comes from RANDOM) i.e. VARIABLE='14' then it will do: sed 's/$/ /' = 14 spaces added at the... (10 Replies)
Discussion started by: holyearth
10 Replies
CONVERTQUOTA(8) 					      System Manager's Manual						   CONVERTQUOTA(8)

NAME
convertquota - convert quota from old file format to new one SYNOPSIS
convertquota [ -ug ] -e filesystem convertquota [ -ug ] -f oldformat,newformat filesystem DESCRIPTION
convertquota converts old quota files quota.user and quota.group to files aquota.user and aquota.group in new format currently used by 2.4.0-ac? and newer or by SuSE or Red Hat Linux 2.4 kernels on filesystem. New file format allows using quotas for 32-bit uids / gids, setting quotas for root, accounting used space in bytes (and so allowing use of quotas in ReiserFS) and it is also architecture independent. This format introduces Radix Tree (a simple form of tree structure) to quota file. OPTIONS
-u, --user convert user quota file. This is the default. -g, --group convert group quota file. -f, --convert-format oldformat,newformat convert quota file from oldformat to newformat. -e, --convert-endian convert vfsv0 file format from big endian to little endian (old kernels had a bug and did not store quota files in little endian format). -V, --version print version information. FILES
aquota.user new user quota file aquota.group new group quota file SEE ALSO
quota(1), setquota(8), edquota(8), quotacheck(8), quotaon(8), repquota(8) AUTHOR
Jan Kara <jack@suse.cz> 4th Berkeley Distribution Fri Aug 20 1999 CONVERTQUOTA(8)
All times are GMT -4. The time now is 06:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy