Sponsored Content
Top Forums UNIX for Advanced & Expert Users Summation of the column value in an interval. Post 302317065 by varungupta on Monday 18th of May 2009 03:14:09 AM
Old 05-18-2009
Summation of the column value in an interval.

Hey,

I have a file with following data..
and I want to get the summation of 10th column. And this happens in every 10 seconds for a minute max.

242001 A mqsitst 794864 1249516 0 60 20 293050400 77016 * 02:05:33 - 0:04 DataFlowEngine EAITIBR2_BROKER 384403e1-1001-0000-0080-cc759314a02e IDS_CCASS 0
242001 A mqsitst 978998 1249516 0 60 20 24284a400 56092 * 02:05:33 - 0:03 DataFlowEngine EAITIBR2_BROKER 9fa202e1-1001-0000-0080-cc759314a02e 21CD1 0
242001 A mqsitst 1040482 1134684 0 60 20 13d86400 78684 * 02:05:35 - 0:04 DataFlowEngine EAIDQBR2_BROKER 6f8aa7d6-1001-0000-0080-be57c7f1134d WAMS1 0

The BOLD faced has to be added and its in the 10th column.

What should i do to make it easily done ?

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to perfrom summation for particular delimited field?

Hi, Please help to share your thought about how to perfrom summation for particular delimited field, and output to the particular file based on -rw-r--r-- 1 abc other 3094 Oct 19 09:40 0132019832-ps5_online_cdrm.unl -rw-r--r-- 1 abc other 1588 Oct 19 09:47... (2 Replies)
Discussion started by: rauphelhunter
2 Replies

2. Shell Programming and Scripting

compare the interval of 2 numbers of input2with interval of several numbers of input1

Help plz Does any one have any idea how to compare interval ranges of 2 files. finding 1-4 (1,2,3,4) of input2 in input1 of same key "a" values (5-10, 30-40, 45-60, 80-90, 100-120 ). Obviously 1-4 is not one of the range with in input1 a. so it should give out of range. finding 30-33(31,32,33)... (1 Reply)
Discussion started by: repinementer
1 Replies

3. UNIX for Dummies Questions & Answers

summation of values coming in a row.

Hi All, I need to sum values in a row. eg: input is: sum,value1,value2,value3,.....,value N Required Output: sum,<summation of N values> Please help me... (1 Reply)
Discussion started by: MrGopal666
1 Replies

4. Shell Programming and Scripting

How to shift values in new column after certain interval?

Hello everyone, my data is in a format as below a a a a a a a a a a a a a a a (8 Replies)
Discussion started by: jojo123
8 Replies

5. Shell Programming and Scripting

Summation of column value in flat file

Hello Guys Please find my below requirement I have a flat file with column headers in first line and data The structure like below col1 col2 col3 A 1 2 B 3 4 C 5 6 Say I have to take the summation of col2 (that will depend on the... (2 Replies)
Discussion started by: Pratik4891
2 Replies

6. Shell Programming and Scripting

calculating column summation in a directory of flat files

Hello Guru s I need your kind help to solve my below issue I have a directory of flat files and have to calculate sum of some columns from the flat file . Say for flat file 302 I need the column summation of 2 and 3 rd column For flat file 303 I need the column summation of 5 and... (2 Replies)
Discussion started by: Pratik4891
2 Replies

7. Shell Programming and Scripting

Awk - Summation in Proper decimal Format

Hi I am executing below command to do summation on 46th coloumn. cat File1| awk -F"|" '{p += $46} END { printf"Column Name | SUM | " p}' I am getting output as Column Name | SUM | 1.01139e+10 Here I want output in Proper decimal format. Can someone tell me what change is required for same? (1 Reply)
Discussion started by: sanranad
1 Replies

8. Shell Programming and Scripting

Modification of Summation Script

hi guys, i have a script that basically just sums up the values of 2 particular columns in a file, grouped by the columns specified as well The script is quite long, but it's basically just repetitive.. just for each condition. This script only accepts one type of input file. ... (22 Replies)
Discussion started by: ramneim
22 Replies

9. Shell Programming and Scripting

Summation of a particular column which are in different folders

I have three folders named f1, f2 and f3. The file names are same in all these folders. I would like to get the summation of the second column from all files. How can I do this ? file1 in f1 folder 143 143.69 60.2 81.30 40.4 62.39 166.3 83.38 107.2 60.30 37.5 144 192.62 107.9... (3 Replies)
Discussion started by: edisonjoe
3 Replies

10. UNIX for Beginners Questions & Answers

Awk/sed summation of one column based on some entry in first column

Hi All , I am having an input file as stated below Input file 6 ddk/djhdj/djhdj/Q 10 0.5 dhd/jdjd.djd.nd/QB 01 0.5 hdhd/jd/jd/jdj/Q 10 0.5 512 hd/hdh/gdh/Q 01 0.5 jdjd/jd/ud/j/QB 10 0.5 HD/jsj/djd/Q 01 0.5 71 hdh/jjd/dj/jd/Q 10 0.5 ... (5 Replies)
Discussion started by: kshitij
5 Replies
IRDADUMP(8)															       IRDADUMP(8)

NAME
irdadump - monitors the IrDA traffic on one or more links. SYNOPSIS
irdadump [ -b ] [ -c n ] [ -d ] [ -x ] [ -s n ] [ -t ] [ -l ] [ -v ] [ -i device ] OPTIONS
-b dump bytes in columns -c n set snapcols for byte printing with -b option -d prints the time difference between the current and the previous frame -x dump frame (bytes and ascii) -s n set snaplen for -b and -x option -t force TTP decoding of unknown connections -l set line buffering on output file -v verbose -i device interface DESCRIPTION
irdadump is a tool for monitoring the IrDA traffic on one or more links. Just write "make" to compile the program. When you run the pro- gram, you should be able to see the IrDA traffic (if any). One advantage of implementing IrDA device drivers as network device drivers is that you should be able to attach sniffers to the device (or actually the packet type). That way, it is possible to use a really handy utility called irdadump (instead of tcpdump). This will make debugging MUCH easier. Linux-2.2 implements the BPF (Berkeley Packet Filter), so its possible to filter out exactly the frames you want to see. You may use hostname to separate different machines names. Or grep to filter the output, too. irdadump must be run as root or installed setuid root, as it requires root privileges. EXAMPLES
The output should look something like this: / # ./irdadump 20:11:45.412199 xid:cmd 0x0015c23b > 0xffffffff S=6 s=0 20:11:45.492137 xid:cmd 0x0015c23b > 0xffffffff S=6 s=1 20:11:45.572137 xid:cmd 0x0015c23b > 0xffffffff S=6 s=2 20:11:45.652208 xid:cmd 0x0015c23b > 0xffffffff S=6 s=3 20:11:45.732137 xid:cmd 0x0015c23b > 0xffffffff S=6 s=4 20:11:45.812137 xid:cmd 0x0015c23b > 0xffffffff S=6 s=5 20:11:45.892175 xid:cmd 0x0015c23b > 0xffffffff S=6 s=255 Linux 20:11:45.902362 xid:rsp 0xf7be8388 < 0x0015c23b S=6 s=5 ACTiSYS IR100M 20:11:48.412197 xid:cmd 0x0015c23b > 0xffffffff S=6 s=0 20:11:48.492656 xid:cmd 0x0015c23b > 0xffffffff S=6 s=1 20:11:48.572177 xid:cmd 0x0015c23b > 0xffffffff S=6 s=2 20:11:48.652169 xid:cmd 0x0015c23b > 0xffffffff S=6 s=3 20:11:48.732177 xid:cmd 0x0015c23b > 0xffffffff S=6 s=4 20:11:48.812153 xid:cmd 0x0015c23b > 0xffffffff S=6 s=5 20:11:48.822371 xid:rsp 0xf7be8388 < 0x0015c23b S=6 s=4 ACTiSYS IR100M 15 packets received by filter Turning on the "-d" option will make irdadump print the time difference between the current and the previous frame: / # ./irdadump -d 20:11:18.412475 (0982.06 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=0 20:11:18.492345 (0079.87 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=1 20:11:18.572376 (0080.03 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=2 20:11:18.652979 (0080.60 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=3 20:11:18.732354 (0079.38 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=4 20:11:18.755093 (0022.74 ms) xid:rsp 0xf7be8388 < 0x0015c23b S=6 s=3 ACTiSYS IR100M 20:11:18.812350 (0057.26 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=5 20:11:18.892518 (0080.17 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=255 Linux 20:11:21.412486 (2519.97 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=0 20:11:21.492395 (0079.91 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=1 20:11:21.572368 (0079.97 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=2 20:11:21.652405 (0080.04 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=3 20:11:21.732458 (0080.05 ms) xid:cmd 0x0015c23b > 0xffffffff S=6 s=4 irdadump must be run as root or installed setuid root, as it requires root privileges. irdadump -d -x -s 256 will check the contents of the frames. This should tell us if the frames have malformed content, or if the irda stack is doing something wrong. DIAGNOSTICS
N.N. BUGS
N.N. SEE ALSO
irattach(8), irdaping(8), irdadump(8), findchip(8), irpsion5(8), modprobe(8) Linux/IrDA Project http://irda.sourceforge.net -*- Linux/IrDA-Tutorial http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/index.html -*- Infrared-HOWTO http://tuxmobil.org/howtos.html AUTHOR
This manual page is written by Werner Heuser <wehe@tuxmobil.org>. It is based on the READMEs from irda-utils by the Linux/IrDA Project and the Linux/IrDA-Tutorial. COPYRIGHT
Copyright (c) 2001 Werner Heuser Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License (GFDL), Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. 03 July 2006 IRDADUMP(8)
All times are GMT -4. The time now is 09:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy