Reattemps Calculation using awk


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Reattemps Calculation using awk
# 1  
Old 04-16-2008
Reattemps Calculation using awk

Dear All

How are you

I have files which look like this :

20080406_12:43:55.779 ISC Sprint- 39 21624032999 218925866728
20080406_12:44:07.811 ISC Sprint- 20 21620241815 218927736810
20080406_12:44:00.485 ISC Sprint- 50 21621910404 218913568053
20080406_12:41:33.779 ISC Sprint- 17 21624247736 218926103389
20080406_12:43:55.038 ISC Sprint- 27 21622534158 218913975171
20080406_12:44:01.928 ISC Sprint- 6 21621941577 218925544285
20080406_12:44:11.283 ISC Sprint- 12 21624307314 218913794921
20080406_12:40:40.166 ISC Sprint- 52 21621603606 218913823593
20080406_12:43:38.822 ISC Sprint- 62 21620348813 218913580432
20080406_12:44:04.168 ISC Sprint- 36 21620415413 218913790347
20080406_12:44:13.982 ISC Sprint- 6 21623171785 218913208380
20080406_12:43:16.016 ISC Sprint- 45 21622691719 218926644360
20080406_12:43:57.288 ISC Sprint- 38 21621848768 218913735624
20080406_12:44:22.698 ISC Sprint- 54 21624307314 218913794921
20080406_12:44:16.119 ISC Sprint- 52 21621910404 218913568053
20080406_12:44:21.540 ISC Sprint- 6 21623165673 218925668272
20080406_12:43:40.990 ISC Sprint- 61 21620150305 218928692370
20080406_12:42:41.258 ISC Sprint- 9 21624121551 218912139338
20080406_12:40:40.529 ISC Sprint- 14 21620616935 218913209052
20080406_12:44:32.169 ISC Sprint- 9 21621989508 218928051629
20080406_12:44:27.921 ISC Sprint- 20 21623692276 218923637292
20080406_12:44:27.440 ISC Sprint- 6 21621300259 218913614624
20080406_12:44:34.883 ISC Sprint- 20 21624307314 218913794921
20080406_12:43:51.168 ISC Sprint- 34 21621539079 218927152496
20080406_12:43:51.542 ISC Sprint- 56 21623513178 218927428474
20080406_12:43:51.174 ISC Sprint- 29 21623072448 218926735947
20080406_12:44:29.696 ISC Sprint- 61 21624032999 218925866728

I want a script which takes these lines and calculates the Repeated times of $5 and $6 , for example in this sample you will find that the first line and last line are identical in $5 and $6 also the time stamp difference is small , so the script should check two conditions:
[LIST] Check that $5 and $6 for the two lines is identical as in the example[LIST] Calculate the time stamp difference in seconds (Ignore ms), it must be less than or equal 2 minutes.

If the two conditions is ok then the complete line ($0) of the two attempts is printed, speed should be normal as the number of calls is large.

Note : I am using Solaris 8

Thanks and best regards
zanetti
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with awk percentage calculation from a file

i have a file say test with the below mentioned details Folder Name Total space Space used /test/test1 500.1GB 112.0 GB /test/test2 3.2 TB 5TB /test/test3 3TB 100GB i need to calculate percentage of each row based on total space and space used and copy... (9 Replies)
Discussion started by: venkitesh
9 Replies

2. Shell Programming and Scripting

awk calculation with zero as N/A

In the below awk, I am trying to calculate percent for a given id. It is very close the problem is when the # being used in the calculation is zero. I am not sure how to code this condition into the awk as it happens frequently. The portion in italics was an attempt but that lead to an error. Thank... (13 Replies)
Discussion started by: cmccabe
13 Replies

3. Shell Programming and Scripting

awk split and awk calculation in the same command

I am trying to run the awk below. My question is when I split the input, then run anotherawk to perform a calculation using that splitas the input there are no issues. When I try to combine them the output is not correct, is the split not working or did I do it wrong? Thank you :). input ... (8 Replies)
Discussion started by: cmccabe
8 Replies

4. Shell Programming and Scripting

Awk or If/statement Calculation Problem

#!/bin/sh CURRENTSTATE=2 CSVCSTATE=2 LASTSTATECHANGE=8 CSVCSTATEAGE=5 if (($CURRENTSTATE==$CSVCSTATE))&&(($LASTSTATECHANGE>=$CSVCSTATEAGE)) echo GREAT fi returns: ./aff: line 12: syntax error near unexpected token `fi' ./aff: line 12: `fi' what am i doing wrong here? (6 Replies)
Discussion started by: SkySmart
6 Replies

5. Programming

arithmetic calculation using awk

hi there again, i need to do a simple division with my data with a number of rows. i think i wanted to have a simple output like this one: col1 col2 col3 val1 val2 val1/val2 valn valm valn/valm any suggestion is very much appreciated. thanks much. (2 Replies)
Discussion started by: ida1215
2 Replies

6. Shell Programming and Scripting

Calculation in Multiple files using awk

Hi All, I have some 10 files named samp1.csv, samp2.csv,... samp10.csv Each file having the same number of fields like, Count, field1, field2, field3. And a source.csv file which has three fields field1, field2, field3. Now, i want to find the total count by taking the field1,... (8 Replies)
Discussion started by: johnwilliams.sp
8 Replies

7. Shell Programming and Scripting

awk - calculation of probability density

Hi all! I have the following problem: I would like to calculate using awk a probability of appearing of a pair of numbers x and y. In other words how frequently do these numbers appear? In the case of only one integer number x ranged for example from 1 to 100 awk one liner has the form: awk... (4 Replies)
Discussion started by: jarowit
4 Replies

8. Shell Programming and Scripting

File Size calculation with AWK

Hello Friends, Im calculating file sizes with below AWK script. I do this before some spesific files are transferred. I run the script it works but after several running it stuck with a limit of 2147483647 (2 Gbytes -1 byte) and cant exceed this. Something is wrong and I can't proceed, would... (1 Reply)
Discussion started by: EAGL€
1 Replies

9. Shell Programming and Scripting

awk calculation problem

I have a list of coordinate data, sampled below. 54555209 784672723 I want it as: 545552.09 7846727.23 Below is my script: BEGIN {FS= " "; OFS= ","} {print $1*.01,$2*.01} This is my outcome: 5.5e7 7.8e8 How do I tell awk that I want to keep all the digits instead of outputting... (1 Reply)
Discussion started by: ndnkyd
1 Replies

10. Shell Programming and Scripting

awk calculation

Hallo all, I have a script which creates an output ... see below: root@a7germ:/tmp/pax > cat 20061117.txt 523.047 521.273 521.034 517.367 516.553 517.793 513.114 513.940 I would like to use awk to calculate the (a)total sum of the numbers (b) The average of the numbers. Please... (4 Replies)
Discussion started by: kekanap
4 Replies
Login or Register to Ask a Question