How to for awk print divide value more than 10000?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to for awk print divide value more than 10000?
# 1  
Old 04-17-2017
Wrench How to for awk print divide value more than 10000?

I have a text file with data in the following format.

Code:
042240.Thor!Loki: Asgard>Seus>/usr/Valhalla/Niflheim/Asgardianos/Seus.ec@266:Service Success => Diff time: 25689 msec, Energy loss = 212, Subr = 6969]
042240.Thor!Cap: Asgard>Hera>/usr/Valhalla/Niflheim/Asgardianos/Hera.ec@252:Begin call service
042240.Thor!Ironman: Asgard>Hel>/usr/Valhalla/Niflheim/Asgardianos/Trolls.ec@3218:Service Success => Diff time: 202 msec, Energy loss = 1324, Subr = 7979]
042240.Thor!Loki: Asgard>Hera>/usr/Valhalla/Niflheim/Asgardianos/Hera.ec@1291:Service Success => Diff time: 35991 msec, Energy loss = 748, Subr = 8989]
042240.Thor!Loki: Asgard>Hera>/usr/Valhalla/Niflheim/Asgardianos/Hera.ec@1291:Service Success => Diff time: 10037 msec, Energy loss = 756, Subr = 5959]


I want to print all the lines where > Diff time: 10000 msec
Code:
042240.Thor!Loki: Asgard>Seus>/usr/Valhalla/Niflheim/Asgardianos/Seus.ec@266:Service Success => Diff time: 25689 msec, Energy loss = 212, Subr = 6969]
042240.Thor!Loki: Asgard>Hera>/usr/Valhalla/Niflheim/Asgardianos/Hera.ec@1291:Service Success => Diff time: 35991 msec, Energy loss = 748, Subr = 8989]
042240.Thor!Loki: Asgard>Hera>/usr/Valhalla/Niflheim/Asgardianos/Hera.ec@1291:Service Success => Diff time: 10037 msec, Energy loss = 756, Subr = 5959]

# 2  
Old 04-18-2017
Try:
Code:
awk '/Diff time:/ && $(NF-8)>10000' file

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Searching a particular string pattern in 10000 files

Problem Statement:- I need to search a particular `String Pattern` in around `10000 files` and find the records which contains that `particular pattern`. I can use `grep` here, but it is taking lots of time. Below is the command I am using to search a `particular string pattern` after... (3 Replies)
Discussion started by: raihan26
3 Replies

2. Shell Programming and Scripting

AWK print number of records, divide this number

I would like to print the number of records of 2 files, and divide the two numbers awk '{print NR}' file1 > output1 awk '{print NR}' file2 > output2 paste output1 output2 > output awl '{print $1/$2}' output > output_2 is there a faster way? (8 Replies)
Discussion started by: programmerc
8 Replies

3. UNIX for Dummies Questions & Answers

Merge files into groups of 10000

Hi Guys, First post! I've seen a few options but dont know the most efficient: I have a directory with a 150,000+ text files in it I want to merge them into files contain 10,000 files with a carriage return in between. Thanks P The following is an example but doesnt limit the... (2 Replies)
Discussion started by: peh
2 Replies

4. UNIX for Dummies Questions & Answers

script to add 10000 users

Hi All i have written the script to add 10000 users, when i execute the script it had no errors ,but the script is not adding the users. pls correct me. i want it using while loop #!bin/sh count=0 while do useradd username$count count=`expr $count + 1` done ~ (2 Replies)
Discussion started by: kalyankalyan
2 Replies

5. Shell Programming and Scripting

awk count characters, sum, and divide by another column

Hi All, I am another biologist attempting to parse a large txt file containing several million lines like: tucosnp 56762 T Y 228 228 60 23 .CcCcc,,..c.c,cc,,.C... What I need to do is get the frequency of periods (.) plus commas (,) in column 9, and populate this number into another... (1 Reply)
Discussion started by: peromhc
1 Replies

6. Web Development

Please till me how to stop or to limit some IP which download files for more than 10000

Please till me how to stop or to limit some IP which download .rm and .mp3 files for more than 10000 times ... I have two cases : 1. code 206 up to 20/second 5 GB or more than that ... 2. code 206 up to 20/second but less than 0.5 GB I used Ddos and mod_evasive20.so <IfModule... (0 Replies)
Discussion started by: nonowa
0 Replies

7. Shell Programming and Scripting

divide with awk

Dear, i want to devide the first 4 values from a raw over the next 4 values like the following: $1+$2+$3+$4 / $5+$6+$7+$8 using AWK ....can someone help me? Sanks (1 Reply)
Discussion started by: tontal
1 Replies

8. Shell Programming and Scripting

How do I get awk to print a " in it's print part?

The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }' I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ". Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies

9. UNIX for Dummies Questions & Answers

Sun E 10000 scripted shutdown

Howdy all. I am trying to configure a command file to be executed from a Sparc station to an E10000 to shut down at the same time. I do not have the hardware in which to actively test the script, but I do need some guidance, and Sun's documention on the E10000 leaves alot to be desired. Here... (1 Reply)
Discussion started by: redfoot
1 Replies
Login or Register to Ask a Question