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 9253765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:18:03+00:00 2026-06-18T11:18:03+00:00

This is the second part of my original problem . File_1 is polled every

  • 0

This is the second part of my original problem.

File_1 is polled every second, the $2 is changing all the time:

0             0.00
1             0.00
2             0.00
3             0.00
4             0.00
5             0.00
6             0.00
7             0.00
8           -40.00
9           -20.00
10          -10.00
11           10.00
12           30.00
13           20.00
14           10.00
15           20.00
16           10.00
17          -10.00
18          -10.00
19          -10.00
20          -10.00
21          -10.00
22           10.00
23            0.00

File_2 is where I want to store min ($1) and max ($2) values and update them. The original File_2 is empty:

0       0.0000      0.0000
1       0.0000      0.0000
2       0.0000      0.0000
3       0.0000      0.0000
4       0.0000      0.0000
5       0.0000      0.0000
6       0.0000      0.0000
7       0.0000      0.0000
8       0.0000      0.0000
9       0.0000      0.0000
10      0.0000      0.0000
11      0.0000      0.0000
12      0.0000      0.0000
13      0.0000      0.0000
14      0.0000      0.0000
15      0.0000      0.0000
16      0.0000      0.0000
17      0.0000      0.0000
18      0.0000      0.0000
19      0.0000      0.0000
20      0.0000      0.0000
21      0.0000      0.0000
22      0.0000      0.0000
23      0.0000      0.0000

I want to store the absolute min and max values in File_2 and update them if a newly polled File_1 $1 contains higher/lower values. That means File_1 $1 has to be checked with File_2 $1 and $2 and if File_1 $1 is lower than File_2 $1 or higher than File_2 $2, then File_2 $1 or File_2 $2 has to be updated. All files are sorted.

Explanation:

This is going to be a radio frequency noise analyzer. Every line is a subchannel, where the rise or drop of the ingress RF noise is measured and read every second (stored in File_1). The goal is to get the absolute minimum and maximum values (or with other words the noise variation) during the measurement for every subchannel (every line) and store it in File_2 for further study.

Thanks 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-06-18T11:18:04+00:00Added an answer on June 18, 2026 at 11:18 am

    I got it using paste and AWK combination. This is the line:

    paste File_1 File_2 | awk '{min = $4; if ($2 < $4){min = $2;} max = $5; if ($2 > $5){max = $2;}print $1"\t"min"\t"max;}' -
    

    You can redirect the output wherever you want to save it. See explanation below.

    Here is the output:

    0   0.0000  0.0000
    1   0.0000  0.0000
    2   0.0000  0.0000
    3   0.0000  0.0000
    4   0.0000  0.0000
    5   0.0000  0.0000
    6   0.0000  0.0000
    7   0.0000  0.0000
    8   -40.00  0.0000
    9   -20.00  0.0000
    10  -10.00  0.0000
    11  0.0000  10.00
    12  0.0000  30.00
    13  0.0000  20.00
    14  0.0000  10.00
    15  0.0000  20.00
    16  0.0000  10.00
    17  -10.00  0.0000
    18  -10.00  0.0000
    19  -10.00  0.0000
    20  -10.00  0.0000
    21  -10.00  0.0000
    22  0.0000  10.00
    23  0.0000  0.0000
    

    Explanation:

    First of all, using paste I get “both files in one”, then I just check for min and max values (if statements in AWK code) and I print the final result for each line.

    PS: Try paste File_1 File_2 if you do not know how it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on this problem, but I cannot figure out the second part. I
Original Question mysql-server-6.0.10 I have this problem, I'm using the COMPRESS function to update
How can I make this second struct work, when the first struct has a
Ok, I need something like this: datediff(second, date_one, date_two) < 1 dates are stored
This is my second attempt at this question . I made a mess of
This is my second question about clicking buttons in JavaScript but this one I'm
This is my second question on Bamboo ( My First One ). My understanding
this is the second game that I'm having issues with in the same area...
If this is the first string : ABCD if this is the second string:
I know I'm a newbie in Rails but this is the second day I'm

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.