**LAST SOLUTION WAS INCORECT***   Write a function extractData in your shell script wparser.bash. This function will perform the core processing logic associated with each file. The main script will just iteratively call this function with different files as its argument.   USE grep, awk, sed, find    This function should accept a data file as its argument. This function should then produce an output of the following format that that contains only the temperature and wind information from the sensors along with a header. (see image; truncated for brevity). A clean format of data like this form can be used by various information processing systems.   The script is basically only including the year, month, day and hour information, followed by the temperature reported by each temperature sensor, and wind speed from wind sensors at that time. If a temperature sensor’s reading is NOINF or MISSED SYNC STEP in the original data file for that particular time, the script must instead output the previous readout for that temperature sensor. For simplicity, you can assume that the first readout for all the temperature sensors in a given day does not have any issues. The output should follow the same order of time as in the original data file. The script also translates the wind speed direction codes (which runs from 0 through 7) to appropriate mnemonics, i.e. (N,NE,E,SE,S,SW,W,NW) respectively. Immediately following the previous output produced from a data file, the script (aka inside the function to be specific) should produce the statistics as to what was the maximum as well as the minimum temperature and wind speed that was reported for a given hour. The format is given below. For this report, it is important to ignore the temperature sensors that it was not able to read data for that hour and consider only the sensors that were functioning and produced a valid reading in that hour.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

**LAST SOLUTION WAS INCORECT***

 

Write a function extractData in your shell script wparser.bash. This function will perform the core processing logic associated with each file. The main script will just iteratively call this function with different files as its argument.

 

USE grep, awk, sed, find 

 

This function should accept a data file as its argument. This function should then produce an output of the following format that that contains only the temperature and wind information from the sensors along with a header. (see image; truncated for brevity). A clean format of data like this form can be used by various information processing systems.

 

The script is basically only including the year, month, day and hour information, followed by the temperature reported by each temperature sensor, and wind speed from wind sensors at that time. If a temperature sensor’s reading is NOINF or MISSED SYNC STEP in the original data file for that particular time, the script must instead output the previous readout for that temperature sensor.

For simplicity, you can assume that the first readout for all the temperature sensors in a given day does not have any issues. The output should follow the same order of time as in the original data file.
The script also translates the wind speed direction codes (which runs from 0 through 7) to appropriate mnemonics, i.e. (N,NE,E,SE,S,SW,W,NW) respectively.

Immediately following the previous output produced from a data file, the script (aka inside the function to be specific) should produce the statistics as to what was the maximum as well as the minimum temperature and wind speed that was reported for a given hour. The format is given below. For this report, it is important to ignore the temperature sensors that it was not able to read data for that hour and consider only the sensors that were functioning and produced a valid reading in that hour.

Processing Data From <path to the filename here>
==
Year, Month, Day,Hour, TempS1,TempS2,TempS3,TempS4,TempS5,WindS1,WindS2,WindS3,WinDir
2022,01,24,00,-0.70,-1.38,-2.15,-2.67,-2.73,1,0,4,NW
..
2022,01,24,04,-3.70,-2.88,-3.65,-8. 18,-5.72,8,6,7,NW
2022,01,24,05,-5.20,-2.88,-5.15,-8. 18,-5.72,13,5,10,S
2022,01,24,06,-5.20,-2.38,-4.65,-7. 18,-4.22,17,4,11,SE
2022,01,24,07,-3.70,-2. 38,-4.65,-6. 68,-3.72,14,6,6, SE
2022,01,24,21,1.80,5.12,2.85,-1.68,3.28,4,4,5,SE
2022,01,24,22,0.80,5.12,1.35,-1.68,3.28,3,0,6,SE
2022,01,24,23,0.80,4.62,-0.15,-1.68,3.28,5,0,7,N
===
Transcribed Image Text:Processing Data From <path to the filename here> == Year, Month, Day,Hour, TempS1,TempS2,TempS3,TempS4,TempS5,WindS1,WindS2,WindS3,WinDir 2022,01,24,00,-0.70,-1.38,-2.15,-2.67,-2.73,1,0,4,NW .. 2022,01,24,04,-3.70,-2.88,-3.65,-8. 18,-5.72,8,6,7,NW 2022,01,24,05,-5.20,-2.88,-5.15,-8. 18,-5.72,13,5,10,S 2022,01,24,06,-5.20,-2.38,-4.65,-7. 18,-4.22,17,4,11,SE 2022,01,24,07,-3.70,-2. 38,-4.65,-6. 68,-3.72,14,6,6, SE 2022,01,24,21,1.80,5.12,2.85,-1.68,3.28,4,4,5,SE 2022,01,24,22,0.80,5.12,1.35,-1.68,3.28,3,0,6,SE 2022,01,24,23,0.80,4.62,-0.15,-1.68,3.28,5,0,7,N ===
2022-01-24 00:05:25 observation line
-0.70 -1.38 -2.15 -2.67 -2.73 1 0 4 7
2022-01-24 03:01:28 performing diagnostics on temp. sensor: 4
2022-01-24 03:03:09 performing diagnostics on temp. sensor: 5
2022-01-24 03:07:25 observation line
-2.70 -2.88 -3.65 MISSED SYNC STEP MISSED SYNC STEP 3 4 77
1
2022-01-24 04:01:14 observation line
-3.70 -2.88 -3.65 -8.18 -5.72 8 67 7
2022-01-24 05:04:18 observation line [data log flushed]
-5.20 -2.88 -5.15 -8.18 -5.72 13 5 10 4
2022-01-24 06:03:08 observation line
-5.20 -2.38 -4.65 -7. 18 -4.22 17 4 11 3
2022-01-24 07:03:50 active power disengaged
..
2022-01-24 16:00:08 performing diagnostics on temp. sensor: 3
2022-01-24 16:02:13 observation line [data log flushed]
2.30 4.62 NOINF -1.18 3.78 12 4 3 7
..
2022-01-24 23:01:34 performing diagnostics on temp. sensor: 4
2022-01-24 23:05:09 observation line
0.80 4.62 -0.15 MISSED SYNC STEP 3.28 5 0 7 0
Transcribed Image Text:2022-01-24 00:05:25 observation line -0.70 -1.38 -2.15 -2.67 -2.73 1 0 4 7 2022-01-24 03:01:28 performing diagnostics on temp. sensor: 4 2022-01-24 03:03:09 performing diagnostics on temp. sensor: 5 2022-01-24 03:07:25 observation line -2.70 -2.88 -3.65 MISSED SYNC STEP MISSED SYNC STEP 3 4 77 1 2022-01-24 04:01:14 observation line -3.70 -2.88 -3.65 -8.18 -5.72 8 67 7 2022-01-24 05:04:18 observation line [data log flushed] -5.20 -2.88 -5.15 -8.18 -5.72 13 5 10 4 2022-01-24 06:03:08 observation line -5.20 -2.38 -4.65 -7. 18 -4.22 17 4 11 3 2022-01-24 07:03:50 active power disengaged .. 2022-01-24 16:00:08 performing diagnostics on temp. sensor: 3 2022-01-24 16:02:13 observation line [data log flushed] 2.30 4.62 NOINF -1.18 3.78 12 4 3 7 .. 2022-01-24 23:01:34 performing diagnostics on temp. sensor: 4 2022-01-24 23:05:09 observation line 0.80 4.62 -0.15 MISSED SYNC STEP 3.28 5 0 7 0
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY