Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7434813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:57:13+00:00 2026-05-29T09:57:13+00:00

I have the next question, I’ll like to have TWO minimun values, a maximun

  • 0

I have the next question, I’ll like to have TWO minimun values, a maximun value and the average for this input:

 Call 1 1.160 ms
 Call 2 0.163 ms
 Call 3 1.154 ms
 Call 4 1.029 ms
 Call 5 0.291 ms
 Call 6 1.186 ms
 Call 7 1.089 ms
 Call 8 1.122 ms
 Call 9 0.975 ms
 Call 10 1.224 ms
 Call 11 0.965 ms
 Call 12 1.047 ms
 Call 13 1.138 ms
 Call 14 1.217 ms
 Call 15 1.189 ms
 Call 16 1.115 ms
 Call 17 0.950 ms
 Call 18 1.112 ms
 Call 19 1.227 ms
 Call 20 1.071 ms
 Call 21 1.108 ms
 Call 22 1.191 ms
 Call 23 1.139 ms
 Call 24 1.032 ms
 Call 25 1.305 ms
 Call 26 1.085 ms
 Call 27 1.404 ms
 Call 28 1.282 ms
 Call 29 1.031 ms
 Call 30 1.018 ms
 Call 31 1.308 ms
 Call 32 1.299 ms
 Call 33 1.096 ms
 Call 34 1.129 ms
 Call 35 1.271 ms
 Call 36 1.035 ms
 Call 37 1.238 ms
 Call 38 1.150 ms
 Call 39 1.042 ms
 Call 40 0.948 ms

I’ve been using those commands:

 awk 'min=="" || $3 < min {min=$3; minline=$0}; END{ print minline}'

 awk '{ if ($3>max) {max=$3; line=$0} } END {print line }'

 awk '{s+=$3} END{print "Number of Calls: "NR, "\nAverage: "s/(NR)}'

The output is this:

 Minimun: Call 18 0.212 ms
 Maximun: Call 27 1.404 ms
 Number of Calls: 40
 Average: 1.1071

But I need to have 2 minimun values, one of them is showed above but the other one should be any number greather than 0.800. I’ve trying this:

 awk 'min=="0.800" || $3 < min {min=$3; minline=$0}; END{ print minline}'

But it shows me nothing. Please, I need your help to place this in a script.

Thank you in advance for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:57:14+00:00Added an answer on May 29, 2026 at 9:57 am
    kent$  awk 'BEGIN{min=999}
    {a[NR]=$0;if($3<min){min=$3;m[1]=NR;}if($3>max){max=$3;m[2]=NR;}m[3]+=$3;}
    END{print "Min:"a[m[1]];
            print "Max:"a[m[2]];
            print "Number Of Calls:" NR;
            print "Avg:"m[3]/NR;
            t=max>0.800?a[m[2]]:"None";
            print "Any greater than 0.800:"t}' yourFile
    

    output:

    Min:Call 2 0.163 ms
    Max:Call 27 1.404 ms
    Number Of Calls:40
    Avg:1.08837
    Any greater than 0.800:Call 27 1.404 ms
    

    Note: for the “any number greater than 0.800”, i just checked the Max, if it >0.800,print it as the magic number. if not, print None.

    EDIT

    changes for OP’s comment:

    kent$  awk 'BEGIN{min=mag=999}
    {a[NR]=$0;if($3<min){min=$3;m[1]=NR;}if($3>max){max=$3;m[2]=NR;}if($3>0.800&&$3<mag){mag=$3;m[4]=NR} m[3]+=$3;}
    END{print "Min:"a[m[1]];
            print "Max:"a[m[2]];
            print "Number Of Calls:" NR;
            print "Avg:"m[3]/NR;
            print "Any greater than 0.800:"a[m[4]]}' yourFile
    

    output:

    Min:Call 2 0.163 ms
    Max:Call 27 1.404 ms
    Number Of Calls:40
    Avg:1.08837
    Any greater than 0.800:Call 40 0.948 ms
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Next question about russian encoding, mssql and python. I have this simple code: import
So I have this app where I get the next question in an activity
I have the next question. There is part of code: $result = $this->find('all', array(
I have next input data, There are two tables create table Courses( id number(19)
i have question about YAJLiOS parser... I have next json data : {{ body
Okay, next PHPExcel question. I have an HTML form that users fill out and
I have next interface public interface IMyInterface { string this[string key] { get; set;
I have next form and some ashx <form action=FileUpload.ashx method=POST enctype=multipart/form-data id=frmUpload> <input id=fileupload
have a next question: i.g. we have next html with structure: <html> <head> <script
I'm new in Android development and I have the next question/problem. I'm playing around

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.