Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2021-02-01 00:02:07 sensor readouts -12.35 -11.90 -11.97 -11.05 -11.65 2021-02-01 01:03:01 rebooting sensor 4 2021-02-01 01:03:02 sensor readouts -13.85 -11.90 -12.97 ERROR -11.65 2021-02-01 02:04:00

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

2021-02-01 00:02:07 sensor readouts -12.35 -11.90 -11.97 -11.05 -11.65 2021-02-01 01:03:01 rebooting sensor 4 2021-02-01 01:03:02 sensor readouts -13.85 -11.90 -12.97 ERROR -11.65 2021-02-01 02:04:00 rebooting sensor 5 2021-02-01 02:05:43 sensor readouts -14.35 -11.90 -13.47 -12.55 ERROR 2021-02-01 03:01:48 sensor readouts -15.35 -13.40 -13.47 -13.55 -13.15 2021-02-01 04:03:32 sensor readouts -15.85 -14.40 -14.97 -15.05 -13.15 2021-02-01 05:01:47 rebooting sensor 2 2021-02-01 05:06:43 sensor readouts -17.35 ERROR -15.97 -16.55 -13.15 2021-02-01 06:04:53 sensor readouts -16.35 -14.90 -15.97 -15.05 -12.65 2021-02-01 07:04:14 sensor readouts -15.85 -14.40 -14.97 -14.05 -11.65 2021-02-01 08:04:38 energy conservation mode is active for the next sample 2021-02-01 08:05:02 sensor readouts -15.35 -13.90 -14.97 -13.05 -11.15 2021-02-01 09:03:31 sensor readouts -14.35 -12.90 -13.97 -13.05 -10.65 2021-02-01 10:04:11 sensor readouts -14.35 -11.90 -13.97 -13.05 -10.65 2021-02-01 11:01:17 rebooting sensor 1 2021-02-01 11:03:21 sensor readouts ERROR -11.40 -12.97 -12.55 -9.65 2021-02-01 12:05:18 rebooting sensor 4 2021-02-01 12:09:08 sensor readouts -12.85 -9.90 -12.97 ERROR -9.15 2021-02-01 13:00:16 energy conservation mode is active for the next sample 2021-02-01 13:04:29 sensor readouts -11.35 -9.40 -11.47 -11.05 -7.65 2021-02-01 14:05:27 sensor readouts -10.85 -7.90 -11.47 -10.05 -6.15 2021-02-01 15:05:19 data uplink failed 2021-02-01 15:07:15 sensor readouts -10.85 -7.90 -10.47 -9.55 -5.15 2021-02-01 16:00:35 rebooting sensor 5 2021-02-01 16:00:48 sensor readouts -10.85 -7.40 -8.97 -9.55 ERROR 2021-02-01 17:04:43 sensor readouts -10.35 -7.40 -7.47 -8.05 -3.65 2021-02-01 18:03:57 rebooting sensor 2 2021-02-01 18:08:47 rebooting sensor 3 2021-02-01 18:12:00 sensor readouts -10.35 ERROR ERROR -7.05 -3.65 2021-02-01 19:04:22 sensor readouts -11.85 -7.40 -6.97 -7.55 -4.15 2021-02-01 20:01:17 rebooting sensor 2 2021-02-01 20:03:38 sensor readouts -12.85 ERROR -6.97 -8.05 -5.65 2021-02-01 21:04:35 rebooting sensor 1 2021-02-01 21:05:01 sensor readouts ERROR -8.40 -7.47 -9.05 -7.15 2021-02-01 22:04:35 sensor readouts -12.85 -9.40 -7.47 -10.05 -7.15 2021-02-01 23:00:39 sensor readouts -12.85 -10.90 -7.47 -10.55 -8.65 2021-01-30 03:02:42 sensor readouts 2021-01-30 06:08:15 sensor readouts 2021-01-30 09:04:04 sensor readouts 2021-01-30 10:07:15 sensor readouts 2021-01-30 11:08:07 sensor readouts 2021-01-30 12:10:06 sensor readouts 2021-01-30 13:11:11 sensor readouts 2021-01-30 16:08:59 sensor readouts 2021-01-30 17:08:51 sensor readouts 2021-01-30 18:07:35 sensor readouts 2021-01-30 20:05:52 sensor readouts 2021-01-30 21:07:12 sensor readouts 2021-01-30 23:09:33 sensor readouts -10.97 -8.30 ERROR -11.22 -10.78 -12.47 ERROR -13.28 -11.22 -9.78 -9.97 -7.30 ERROR -7.22 -6.78 -8.47 -6.30 ERROR -5.72 ERROR ERROR -6.30 -11.78 -5.72 -5.28 -7.97 ERROR -10.78 -4.72 -4.78 -7.47 -4.30 ERROR -4.22 -4.28 -5.47 -1.80 -7.78 ERROR ERROR -3.97 -1.30 -7.28 -4.22 ERROR ERROR 0.20 -7.28 -4.22 -0.28 -3.97 -0.30 -7.78 ERROR -1.78 -4.47 -1.30 ERROR -5.72 -1.78 -5.97 -1.80 ERROR -6.22 -2.28 2021-01-30 07:09:16 sensor readouts -11.47 -8.80 -12.28 -10.22 -9.28 2021-01-30 08:02:35 sensor readouts -10.47 -8.80 -12.28 -8.72 -8.28 2021-01-30 09:03:52 rebooting sensor 3 2021-01-30 09:04:04 sensor readouts -9.97 -7.30 ERROR -7.22 -6.78 2021-01-30 10:01:27 rebooting sensor 3 2021-01-30 10:03:27 rebooting sensor 5 2021-01-30 10:07:15 sensor readouts -8.47 -6.30 ERROR -5.72 ERROR 2021-01-30 11:03:36 energy conservation mode is active for the next sample 2021-01-30 11:04:43 rebooting sensor 1 2021-01-30 11:08:07 sensor readouts ERROR -6.30 -11.78 -5.72 -5.28 2021-01-30 12:01:10 energy conservation mode is active for the next sample 2021-01-30 12:05:32 rebooting sensor 2 2021-01-30 12:10:06 sensor readouts -7.97 ERROR -10.78 -4.72 -4.78 2021-01-30 13:05:39 rebooting sensor 3 2021-01-30 13:11:11 sensor readouts -7.47 -4.30 ERROR -4.22 -4.28 2021-01-30 14:03:12 sensor readouts -7.47 -3.30 -8.78 -4.22 -3.28 2021-01-30 15:03:47 sensor readouts -5.97 -3.30 -8.78 -4.22 -1.78 2021-01-30 16:01:37 rebooting sensor 4 2021-01-30 16:03:09 rebooting sensor 5 2021-01-30 16:08:59 sensor readouts -5.47 -1.80 -7.78 ERROR ERROR 2021-01-30 17:03:40 rebooting sensor 5 2021-01-30 17:08:51 sensor readouts -3.97 -1.30 -7.28 -4.22 ERROR 2021-01-30 18:02:01 rebooting sensor 1 2021-01-30 18:07:35 sensor readouts ERROR 0.20 -7.28 -4.22 -0.28 2021-01-30 19:03:18 sensor readouts -2.47 -0.30 -7.28 -5.72 -0.78 2021-01-30 20:04:23 rebooting sensor 4 2021-01-30 20:05:52 sensor readouts -3.97 -0.30 -7.78 ERROR -1.78 2021-01-30 21:05:11 rebooting sensor 3 2021-01-30 21:07:12 sensor readouts -4.47 -1.30 ERROR -5.72 -1.78 2021-01-30 22:00:32 sensor readouts -5.97 -1.80 -8.78 -6.22 -1.78 2021-01-30 23:05:07 rebooting sensor 3 2021-01-30 23:09:33 sensor readouts -5.97 -1.80 ERROR -6.22 -2.28 2021-01-25 07:03:22 rebooting sensor 2 2021-01-25 07:04:07 sensor readouts Reload Content 7 0.07 -3.25 2021-01-25 08:00:47 sensor readouts -0.02 0.13 0.57 1.07 -2.25 2021-01-25 09:00:26 sensor readouts 0.48 1.73 1.57 1.07 -1.75 2021-01-25 10:05:55 rebooting sensor 3 2021-01-25 10:11:05 sensor readouts 0.98 1.73 ERROR 1.57 -1.75 2021-01-25 11:05:07 rebooting sensor 2 2021-01-25 11:07:23 sensor readouts 0.98 ERROR 2.58 2.08 -0.25 2021-01-25 12:04:19 rebooting sensor 2 2021-01-25 12:07:22 rebooting sensor 4 2021-01-25 12:11:25 sensor readouts 1.98 ERROR 3.08 ERROR 0.75 2021-01-25 13:02:19 rebooting sensor 1 2021-01-25 13:05:23 sensor readouts ERROR 3.73 3.08 5.08 0.75 2021-01-25 14:01:42 sensor readouts 3.48 3.73 4.08 5.08 0.75 2021-01-25 15:05:43 sensor readouts 4.97 3.73 4.58 6.58 2.25 2021-01-25 16:02:47 energy conservation mode is active for the next sample 2021-01-25 16:07:57 rebooting sensor 1 2021-01-25 16:12:04 sensor readouts ERROR 3.73 5.58 7.08 2.25 2021-01-25 17:03:06 energy conservation mode is active for the next sample 2021-01-25 17:06:10 sensor readouts 6.97 4.22 6.08 8.57 2.75 2021-01-25 18:03:25 data uplink failed 2021-01-25 18:05:40 rebooting sensor 3 2021-01-25 18:09:30 sensor readouts 7.97 4.72 ERROR 9.07 3.75 2021-01-25 19:03:38 rebooting sensor 1 2021-01-25 19:04:33 rebooting sensor 2 2021-01-25 19:10:03 sensor readouts ERROR ERROR 6.08 9.07 3.75 2021-01-25 20:04:25 rebooting sensor 2 2021-01-25 20:07:52 rebooting sensor 3 2021-01-25 20:07:56 sensor readouts 5.97 ERROR ERROR 7.57 2.25 2021-01-25 21:00:35 sensor readouts 4.97 4.22 5.08 6.57 2.25 2021-01-25 22:00:06 sensor readouts 3.47 4.22 4.08 5.07 0.75 2021-01-25 23:01:48 sensor readouts 2.97 4.22 4.08 3.57 -0.25 Ex. 1 Parsing sensor logs for analysis (20 Points) The output produced by specialized software applications often contain a mixture of diagnostic details as well as useful data. By processing their log files, we can glean for various useful information. In this assignment, we will use the advanced Unix utilities that we covered in class to analyze the output log files from a temperature sensors monitoring program. The log files that we will be using for this assignment is available under the directory hierarchy of /home/2013/jdsilv2/206/m3/sensorlogs. Please note that this directory may not be accessible through FileZilla, etc. It is primarily meant to be accessed from the Unix command line in mimi. These will also be the files that TAS will be using to test your scripts. The log files are generated by a program that reads five different temperature sensors, once every hour (24 readings in a given day) and records these readings. If it was unable to read a particular sensor, it will indicate the corresponding sensor's reading as ERROR. Along with this, the program also logs various other information (such as rebooting sensors, etc.) which we are not concerned with. A sample output of one of these log files is given below. (truncated for brevity). You can deduce the message formats from the log files given to you as part of this assignment. Please note that positive temperature readings do not have an explicit + sign associated with them. For simplicity, you can assume that the temperature values are limited in the range of 100.00 to -100.00, inclusive. 2021-02-01 00:02:07 sensor readouts -12.35 -11.90 -11.97 -11.05 -11.65 1 2021-02-01 01:03:01 rebooting sensor 4 2021-02-01 01:03:02 sensor readouts -13.85 -11.90 -12.97 ERROR -11.65 2021-02-01 02:04:00 rebooting sensor 5 2021-02-01 18:03:57 rebooting sensor 2 2021-02-01 18:08:47 rebooting sensor 3 2021-02-01 18:12:00 sensor readouts -10.35 ERROR ERROR -7.05 -3.65 2021-02-01 19:04:22 sensor readouts -11.85 -7.40 -6.97 -7.55 -4.15 2021-02-01 23:00:39 sensor readouts -12.85 -10.90 -7.47 -10.55 -8.65 4. (8 Points) For each log file found, you should produce an output of the following format that contains only the temperature information from the sensors along with a header. (Truncated for brevity). As you can see, a more structured format like this could be easily used by applications that visualize data, etc. Processing sensor data set for Year, Month,Hour, Sensor1, Sensor2, Sensor3, Sensor4, Sensors 2021,02,01,00,-12.35,-11.90,-11.97,-11.05,-11.65 2021,02,01,01,-13.85,-11.90,-12.97,-11.05.-11.65 2021,02,01,02,-14.35,-11.90,-13.47,-12.55,-11.65 2021,02,01,22,-12.85,-9.40,-7.47,-10.05,-7.15 2021,02,01,23,-12.85,-10.90,-7.47,-10.55,-8.65 ===== =========== The script is basically only including the year, month, day and hour information, followed by the temperature reported by each sensor at that time. If a sensor's reading is ERROR in the original log file for that particular time, the script must instead output the previous readout for that sensor. Such "data cleaning" steps are necessary to use data sets with many analytical applications that cannot work with missing data. For simplicity, you can assume that the first readout for all the sensors in a given day does not error out. The output should follow the same order of time as in the original log file. When you are processing multiple logfile, you can process them in any order. 2021-02-01 00:02:07 sensor readouts -12.35 -11.90 -11.97 -11.05 -11.65 2021-02-01 01:03:01 rebooting sensor 4 2021-02-01 01:03:02 sensor readouts -13.85 -11.90 -12.97 ERROR -11.65 2021-02-01 02:04:00 rebooting sensor 5 2021-02-01 02:05:43 sensor readouts -14.35 -11.90 -13.47 -12.55 ERROR 2021-02-01 03:01:48 sensor readouts -15.35 -13.40 -13.47 -13.55 -13.15 2021-02-01 04:03:32 sensor readouts -15.85 -14.40 -14.97 -15.05 -13.15 2021-02-01 05:01:47 rebooting sensor 2 2021-02-01 05:06:43 sensor readouts -17.35 ERROR -15.97 -16.55 -13.15 2021-02-01 06:04:53 sensor readouts -16.35 -14.90 -15.97 -15.05 -12.65 2021-02-01 07:04:14 sensor readouts -15.85 -14.40 -14.97 -14.05 -11.65 2021-02-01 08:04:38 energy conservation mode is active for the next sample 2021-02-01 08:05:02 sensor readouts -15.35 -13.90 -14.97 -13.05 -11.15 2021-02-01 09:03:31 sensor readouts -14.35 -12.90 -13.97 -13.05 -10.65 2021-02-01 10:04:11 sensor readouts -14.35 -11.90 -13.97 -13.05 -10.65 2021-02-01 11:01:17 rebooting sensor 1 2021-02-01 11:03:21 sensor readouts ERROR -11.40 -12.97 -12.55 -9.65 2021-02-01 12:05:18 rebooting sensor 4 2021-02-01 12:09:08 sensor readouts -12.85 -9.90 -12.97 ERROR -9.15 2021-02-01 13:00:16 energy conservation mode is active for the next sample 2021-02-01 13:04:29 sensor readouts -11.35 -9.40 -11.47 -11.05 -7.65 2021-02-01 14:05:27 sensor readouts -10.85 -7.90 -11.47 -10.05 -6.15 2021-02-01 15:05:19 data uplink failed 2021-02-01 15:07:15 sensor readouts -10.85 -7.90 -10.47 -9.55 -5.15 2021-02-01 16:00:35 rebooting sensor 5 2021-02-01 16:00:48 sensor readouts -10.85 -7.40 -8.97 -9.55 ERROR 2021-02-01 17:04:43 sensor readouts -10.35 -7.40 -7.47 -8.05 -3.65 2021-02-01 18:03:57 rebooting sensor 2 2021-02-01 18:08:47 rebooting sensor 3 2021-02-01 18:12:00 sensor readouts -10.35 ERROR ERROR -7.05 -3.65 2021-02-01 19:04:22 sensor readouts -11.85 -7.40 -6.97 -7.55 -4.15 2021-02-01 20:01:17 rebooting sensor 2 2021-02-01 20:03:38 sensor readouts -12.85 ERROR -6.97 -8.05 -5.65 2021-02-01 21:04:35 rebooting sensor 1 2021-02-01 21:05:01 sensor readouts ERROR -8.40 -7.47 -9.05 -7.15 2021-02-01 22:04:35 sensor readouts -12.85 -9.40 -7.47 -10.05 -7.15 2021-02-01 23:00:39 sensor readouts -12.85 -10.90 -7.47 -10.55 -8.65 2021-01-30 03:02:42 sensor readouts 2021-01-30 06:08:15 sensor readouts 2021-01-30 09:04:04 sensor readouts 2021-01-30 10:07:15 sensor readouts 2021-01-30 11:08:07 sensor readouts 2021-01-30 12:10:06 sensor readouts 2021-01-30 13:11:11 sensor readouts 2021-01-30 16:08:59 sensor readouts 2021-01-30 17:08:51 sensor readouts 2021-01-30 18:07:35 sensor readouts 2021-01-30 20:05:52 sensor readouts 2021-01-30 21:07:12 sensor readouts 2021-01-30 23:09:33 sensor readouts -10.97 -8.30 ERROR -11.22 -10.78 -12.47 ERROR -13.28 -11.22 -9.78 -9.97 -7.30 ERROR -7.22 -6.78 -8.47 -6.30 ERROR -5.72 ERROR ERROR -6.30 -11.78 -5.72 -5.28 -7.97 ERROR -10.78 -4.72 -4.78 -7.47 -4.30 ERROR -4.22 -4.28 -5.47 -1.80 -7.78 ERROR ERROR -3.97 -1.30 -7.28 -4.22 ERROR ERROR 0.20 -7.28 -4.22 -0.28 -3.97 -0.30 -7.78 ERROR -1.78 -4.47 -1.30 ERROR -5.72 -1.78 -5.97 -1.80 ERROR -6.22 -2.28 2021-01-30 07:09:16 sensor readouts -11.47 -8.80 -12.28 -10.22 -9.28 2021-01-30 08:02:35 sensor readouts -10.47 -8.80 -12.28 -8.72 -8.28 2021-01-30 09:03:52 rebooting sensor 3 2021-01-30 09:04:04 sensor readouts -9.97 -7.30 ERROR -7.22 -6.78 2021-01-30 10:01:27 rebooting sensor 3 2021-01-30 10:03:27 rebooting sensor 5 2021-01-30 10:07:15 sensor readouts -8.47 -6.30 ERROR -5.72 ERROR 2021-01-30 11:03:36 energy conservation mode is active for the next sample 2021-01-30 11:04:43 rebooting sensor 1 2021-01-30 11:08:07 sensor readouts ERROR -6.30 -11.78 -5.72 -5.28 2021-01-30 12:01:10 energy conservation mode is active for the next sample 2021-01-30 12:05:32 rebooting sensor 2 2021-01-30 12:10:06 sensor readouts -7.97 ERROR -10.78 -4.72 -4.78 2021-01-30 13:05:39 rebooting sensor 3 2021-01-30 13:11:11 sensor readouts -7.47 -4.30 ERROR -4.22 -4.28 2021-01-30 14:03:12 sensor readouts -7.47 -3.30 -8.78 -4.22 -3.28 2021-01-30 15:03:47 sensor readouts -5.97 -3.30 -8.78 -4.22 -1.78 2021-01-30 16:01:37 rebooting sensor 4 2021-01-30 16:03:09 rebooting sensor 5 2021-01-30 16:08:59 sensor readouts -5.47 -1.80 -7.78 ERROR ERROR 2021-01-30 17:03:40 rebooting sensor 5 2021-01-30 17:08:51 sensor readouts -3.97 -1.30 -7.28 -4.22 ERROR 2021-01-30 18:02:01 rebooting sensor 1 2021-01-30 18:07:35 sensor readouts ERROR 0.20 -7.28 -4.22 -0.28 2021-01-30 19:03:18 sensor readouts -2.47 -0.30 -7.28 -5.72 -0.78 2021-01-30 20:04:23 rebooting sensor 4 2021-01-30 20:05:52 sensor readouts -3.97 -0.30 -7.78 ERROR -1.78 2021-01-30 21:05:11 rebooting sensor 3 2021-01-30 21:07:12 sensor readouts -4.47 -1.30 ERROR -5.72 -1.78 2021-01-30 22:00:32 sensor readouts -5.97 -1.80 -8.78 -6.22 -1.78 2021-01-30 23:05:07 rebooting sensor 3 2021-01-30 23:09:33 sensor readouts -5.97 -1.80 ERROR -6.22 -2.28 2021-01-25 07:03:22 rebooting sensor 2 2021-01-25 07:04:07 sensor readouts Reload Content 7 0.07 -3.25 2021-01-25 08:00:47 sensor readouts -0.02 0.13 0.57 1.07 -2.25 2021-01-25 09:00:26 sensor readouts 0.48 1.73 1.57 1.07 -1.75 2021-01-25 10:05:55 rebooting sensor 3 2021-01-25 10:11:05 sensor readouts 0.98 1.73 ERROR 1.57 -1.75 2021-01-25 11:05:07 rebooting sensor 2 2021-01-25 11:07:23 sensor readouts 0.98 ERROR 2.58 2.08 -0.25 2021-01-25 12:04:19 rebooting sensor 2 2021-01-25 12:07:22 rebooting sensor 4 2021-01-25 12:11:25 sensor readouts 1.98 ERROR 3.08 ERROR 0.75 2021-01-25 13:02:19 rebooting sensor 1 2021-01-25 13:05:23 sensor readouts ERROR 3.73 3.08 5.08 0.75 2021-01-25 14:01:42 sensor readouts 3.48 3.73 4.08 5.08 0.75 2021-01-25 15:05:43 sensor readouts 4.97 3.73 4.58 6.58 2.25 2021-01-25 16:02:47 energy conservation mode is active for the next sample 2021-01-25 16:07:57 rebooting sensor 1 2021-01-25 16:12:04 sensor readouts ERROR 3.73 5.58 7.08 2.25 2021-01-25 17:03:06 energy conservation mode is active for the next sample 2021-01-25 17:06:10 sensor readouts 6.97 4.22 6.08 8.57 2.75 2021-01-25 18:03:25 data uplink failed 2021-01-25 18:05:40 rebooting sensor 3 2021-01-25 18:09:30 sensor readouts 7.97 4.72 ERROR 9.07 3.75 2021-01-25 19:03:38 rebooting sensor 1 2021-01-25 19:04:33 rebooting sensor 2 2021-01-25 19:10:03 sensor readouts ERROR ERROR 6.08 9.07 3.75 2021-01-25 20:04:25 rebooting sensor 2 2021-01-25 20:07:52 rebooting sensor 3 2021-01-25 20:07:56 sensor readouts 5.97 ERROR ERROR 7.57 2.25 2021-01-25 21:00:35 sensor readouts 4.97 4.22 5.08 6.57 2.25 2021-01-25 22:00:06 sensor readouts 3.47 4.22 4.08 5.07 0.75 2021-01-25 23:01:48 sensor readouts 2.97 4.22 4.08 3.57 -0.25 Ex. 1 Parsing sensor logs for analysis (20 Points) The output produced by specialized software applications often contain a mixture of diagnostic details as well as useful data. By processing their log files, we can glean for various useful information. In this assignment, we will use the advanced Unix utilities that we covered in class to analyze the output log files from a temperature sensors monitoring program. The log files that we will be using for this assignment is available under the directory hierarchy of /home/2013/jdsilv2/206/m3/sensorlogs. Please note that this directory may not be accessible through FileZilla, etc. It is primarily meant to be accessed from the Unix command line in mimi. These will also be the files that TAS will be using to test your scripts. The log files are generated by a program that reads five different temperature sensors, once every hour (24 readings in a given day) and records these readings. If it was unable to read a particular sensor, it will indicate the corresponding sensor's reading as ERROR. Along with this, the program also logs various other information (such as rebooting sensors, etc.) which we are not concerned with. A sample output of one of these log files is given below. (truncated for brevity). You can deduce the message formats from the log files given to you as part of this assignment. Please note that positive temperature readings do not have an explicit + sign associated with them. For simplicity, you can assume that the temperature values are limited in the range of 100.00 to -100.00, inclusive. 2021-02-01 00:02:07 sensor readouts -12.35 -11.90 -11.97 -11.05 -11.65 1 2021-02-01 01:03:01 rebooting sensor 4 2021-02-01 01:03:02 sensor readouts -13.85 -11.90 -12.97 ERROR -11.65 2021-02-01 02:04:00 rebooting sensor 5 2021-02-01 18:03:57 rebooting sensor 2 2021-02-01 18:08:47 rebooting sensor 3 2021-02-01 18:12:00 sensor readouts -10.35 ERROR ERROR -7.05 -3.65 2021-02-01 19:04:22 sensor readouts -11.85 -7.40 -6.97 -7.55 -4.15 2021-02-01 23:00:39 sensor readouts -12.85 -10.90 -7.47 -10.55 -8.65 4. (8 Points) For each log file found, you should produce an output of the following format that contains only the temperature information from the sensors along with a header. (Truncated for brevity). As you can see, a more structured format like this could be easily used by applications that visualize data, etc. Processing sensor data set for Year, Month,Hour, Sensor1, Sensor2, Sensor3, Sensor4, Sensors 2021,02,01,00,-12.35,-11.90,-11.97,-11.05,-11.65 2021,02,01,01,-13.85,-11.90,-12.97,-11.05.-11.65 2021,02,01,02,-14.35,-11.90,-13.47,-12.55,-11.65 2021,02,01,22,-12.85,-9.40,-7.47,-10.05,-7.15 2021,02,01,23,-12.85,-10.90,-7.47,-10.55,-8.65 ===== =========== The script is basically only including the year, month, day and hour information, followed by the temperature reported by each sensor at that time. If a sensor's reading is ERROR in the original log file for that particular time, the script must instead output the previous readout for that sensor. Such "data cleaning" steps are necessary to use data sets with many analytical applications that cannot work with missing data. For simplicity, you can assume that the first readout for all the sensors in a given day does not error out. The output should follow the same order of time as in the original log file. When you are processing multiple logfile, you can process them in any order

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

=+Do you have relevant work experience

Answered: 1 week ago