Sponsored Content
Full Discussion: Add up numbers for each day
Top Forums Shell Programming and Scripting Add up numbers for each day Post 302391495 by Scott on Monday 1st of February 2010 01:45:57 PM
Old 02-01-2010
Code:
awk -F, '
  { S[$1 "." $2 "." $3 ]+=$4 }
  END { for( s in S )
    print s, S[s]
  }
' file1 | sort -nk1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add some numbers!

im using this command to return the number of links in my directory, grep -c -i -h "href" *html */*html *htm *shtml is there a way of adding these to get the total? Cheers (3 Replies)
Discussion started by: TalkShowHost
3 Replies

2. Shell Programming and Scripting

How to add numbers?

:confused: I have plain text file "tmp" which include a range of numbers(bytes), say like: 123 234 567 2434 2323 213123 How can I add them and display out. should I use AWK, then how? I am a newer in Bourne shell, please give me a hand, thanks a lot (7 Replies)
Discussion started by: pnxi
7 Replies

3. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies

4. Shell Programming and Scripting

How to add numbers

Hello. I new to Shell Scripting. I have a file and here is the output of the file. 1.1M 1.1M 3.3M 149K 61K 75K 144K 135K 82K 170K 327K 2.0M 219K 165K (8 Replies)
Discussion started by: email-lalit
8 Replies

5. UNIX for Dummies Questions & Answers

Add a day to a given date

Hi, I have a date field which is a variable field being passed to the script from outside. I need to know how i can add 1 day to it. I have seen example of date subtraction but while adding each time date reaches 31 or 30 i have to put if else condition. Or for leap year also. Kindly let... (4 Replies)
Discussion started by: pallet
4 Replies

6. UNIX for Dummies Questions & Answers

how can i add two numbers

hi, i am having one file which looks like the one below: ABC1 *** 1 4 ABC2 *** 7 12 ABC3 *** 0 34 ... (4 Replies)
Discussion started by: kripssmart
4 Replies

7. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

8. Shell Programming and Scripting

script to find filenames with latest version and for all seq. numbers in a day

Hi, We have a requirement to find the set of filenames from the group of files in a specified folder based on (i) version number (ii) sequence number such that, for any given sequence number in a day only the latest version filenames have to indentified. Below is the format of... (4 Replies)
Discussion started by: Deepakbabu
4 Replies

9. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

10. Shell Programming and Scripting

How to add day of week at the end of each line that shows the date?

I have a file that looks like: file1: www_blank_com 20121008153552 www_blank_com 20121008162542 www_blank_com 20121009040540 www_blank_com 20121009041542 www_blank_com 20121010113548 www_blank_com 20121011113551 www_blank_com 20121012113542 I want the new file to show the day of... (3 Replies)
Discussion started by: castrojc
3 Replies
GTIMER(1)							      GTimer								 GTIMER(1)

NAME
gtimer - an application for recording time spent on user-defined tasks. SYNOPSIS
gtimer [-midnight offset] [-weekstart day] [-nosplash] [-resume] [-start task] DESCRIPTION
GTimer allows the user to time one or more activities. Users define tasks that can be timed. Text annotations can also be added to tasks. Reports can be generated that summarize time spent and annotations. OPTIONS
-midnight offset Specify the offset of midnight to use. Users can allow time spent after midnight to be recorded for the previous day. For exam- ple, the command gtimer -midnight 400 will not consider everything 3:59AM the previous day. -weekstart day Specify which day of the week should be considered the beginning of the week when generating reports. day should be a number between 0 and 6, where 0 is Sunday. For example, the command gtimer -weekstart 1 will use Monday as the first day of the week for all weekly reports. The default is 0 (Sunday). -resume Start timing any tasks that were still be timed when GTimer last exited. -start taskname Start timing the specified task immediately. This option can be used more than once on the command line. For example, you can start a tasks with: gtimer -start 'GTimer development' -nosplash Do not display the splash window on startup. FILES
~/.gtimer/ data storage SEE ALSO
enscript(1), lpr(1) AUTHOR
Craig Knudsen <cknudsen@cknudsen.com> <http://www.cknudsen.com/> GTimer WWW home page: <http://www.cknudsen.com/gtimer/> GTimer Mar 19, 2003 GTIMER(1)
All times are GMT -4. The time now is 06:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy