Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that will go through the lines in input.txt: a . If a line begins with From ( use regular expressions to find
Write a program that will go through the lines in input.txt:
a If a line begins with From use regular expressions to find the lines
i Extract the email address, day, date, month, year, and time please note that there should be a space after the word From to avoid logic errors
ii Send the details to a csv file named output.csv with the help of csv methods. This output.csv file should be stored in the same location as the script file.
iii. The contents of your output.csv file should be identical to sample.csv include the header row
b If a line begins with From: use regular expressions to find the lines
i Extract the email address please note that the colon is part of the word because there are lines that begin with From without a colon at the end
ii Keep track of how many times an email is sent from a particular address with the help of a dictionary.
iii. Send your dictionary results to an output file called output.txt Write a program that will go through the lines in input.txt:
a If a line begins with From use regular expressions to find the lines
i Extract the email address, day, date, month, year, and time please note that there should be a space after the word From to avoid logic errors
ii Send the details to a csv file named output.csv with the help of csv methods. This output.csv file should be stored in the same location as the script file.
iii. The contents of your output.csv file should be identical to sample.csv include the header row
b If a line begins with From: use regular expressions to find the lines
i Extract the email address please note that the colon is part of the word because there are lines that begin with From without a colon at the end
ii Keep track of how many times an email is sent from a particular address with the help of a dictionary.
iii. Send your dictionary results to an output file called output.txt This output.txt file should be stored in the same location as the script file.
iv The contents of your output.txt file should be identical to sample.txt include the last row showing total email count This output.txt file should be stored in the same location as the script file.
iv The contents of your output.txt file should be identical to sample.txt include the last row showing total email count
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started