Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here hdfbgd Here is a sample of the text: Mar 7 04:02:08 avas syslogd 1.4.1: restart.. Mar 7 04:02:16 avas clamd[11165]: /var/amavis/amavis-20040307T033734-10329/parts/part-00003: Worm.Mydoom.F FOUND Mar

Here hdfbgdimage text in transcribed

Here is a sample of the text:

Mar 7 04:02:08 avas syslogd 1.4.1: restart.. Mar 7 04:02:16 avas clamd[11165]: /var/amavis/amavis-20040307T033734-10329/parts/part-00003: Worm.Mydoom.F FOUND Mar 7 04:05:55 avas clamd[11240]: /var/amavis/amavis-20040307T035901-10615/parts/part-00002: Worm.SomeFool.Gen-1 FOUND Mar 7 04:11:15 avas dccifd[11335]: write(MTA socket,4): Broken pipe Mar 7 04:14:12 avas clamd[11346]: /var/amavis/amavis-20040307T033734-10329/parts/part-00002: Worm.SomeFool.Gen-2 FOUND Mar 7 04:58:25 avas clamd[27173]: SelfCheck: Database status OK. Mar 7 05:20:01 avas clamd[20434]: /var/amavis/amavis-20040307T051352-20223/parts/part-00003: Worm.Mydoom.F FOUND Mar 7 05:59:01 avas clamd[27173]: SelfCheck: Database modification detected. Forcing reload. Mar 7 05:59:01 avas clamd[27173]: Reading databases from /usr/local/share/clamav Mar 7 05:59:02 avas clamd[27173]: Database correctly reloaded (20400 viruses) Mar 7 06:12:56 avas dccifd[21165]: write(MTA socket,4): Broken pipe Mar 7 06:16:58 avas clamd[21205]: /var/amavis/amavis-20040307T055611-20898/parts/part-00003: Worm.SomeFool.Gen-2 FOUND Mar 7 06:31:01 avas clamd[21468]: /var/amavis/amavis-20040307T055816-20911/parts/part-00002: Worm.SomeFool.Gen-2 FOUND Mar 7 06:55:07 avas clamd[21758]: /var/amavis/amavis-20040307T065507-21648/parts/part-00002: Worm.SomeFool.Gen-2 FOUND Mar 7 06:59:38 avas clamd[27173]: SelfCheck: Database status OK. Mar 7 07:09:16 avas clamd[21960]: /var/amavis/amavis-20040307T070505-21901/parts/part-00003: Worm.Mydoom.F FOUND Mar 7 07:10:24 avas clamd[22042]: /var/amavis/amavis-20040307T063459-21378/parts/part-00005: Worm.Mydoom.F FOUND Mar 7 07:11:40 avas clamd[22051]: /var/amavis/amavis-20040307T063459-21378/parts/part-00002: Worm.SomeFool.Gen-1 FOUND Mar 7 07:48:48 avas clamd[22604]: /var/amavis/amavis-20040307T072456-22192/parts/part-00004: Worm.SomeFool.Gen-1 FOUND Mar 7 07:55:19 avas clamd[22713]: /var/amavis/amavis-20040307T072857-22254/parts/part-00003: Worm.Mydoom.F FOUND Mar 7 08:00:14 avas clamd[27173]: SelfCheck: Database status OK. Mar 7 08:09:21 avas clamd[22911]: /var/amavis/amavis-20040307T075457-22606/parts/part-00002: Worm.SomeFool.Gen-1 FOUND Mar 7 08:32:49 avas clamd[23343]: /var/amavis/amavis-20040307T082152-23065/parts/part-00002: Worm.SomeFool.Gen-2 FOUND Mar 7 08:45:10 avas clamd[23679]: /var/amavis/amavis-20040307T083333-23327/parts/part-00005: Worm.SomeFool.Gen-1 FOUND Mar 7 08:52:26 avas clamd[23961]: /var/amavis/amavis-20040307T085040-23696/parts/part-00002: Worm.SomeFool.Gen-1 FOUND

Week Two Assignment 1 - File Processing Complete the script below to do the following: 1) Add your name, date, assignment number to the top of this script 2) Open the file redhat.txt a) Iterate through each line of the file b) Split eachline into individual fields (hint str.split0 method) c) Examine each field of the resulting field list d) If the word "worm" appears in the field then add the worm name to the set of worms e) Once you have processed all the lines in the file sort the set iterate through the set of worm names print each unqiue worm name 3) Submit NamingConvention: lastNameFirstInitial_Assignment_.ext for example: hosmerC_WK2-1_script.py hosmerC_WK2-2_screenshot.jpg A) Screenshot of the results in WingIDE B) Your Script import os uniqueWorms =set0 with open("redhat.txt", 'r') as logFile: for eachLine in logFile: "' your code starts here

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

Students also viewed these Databases questions