Question
Create a Python 3 program that imports a CSV file and uses a sequential search to change the e-mail addresses in the CSV file for
Create a Python 3 program that imports a CSV file and uses a sequential search to change the e-mail addresses in the CSV file for all employees working in the MIS department. All employees have a TLD of .com currently, and all employees in the MIS Department need to have their TLD changed to .net. The program must use a sequential search and a for/while loop during search. Count the number of e-mail addresses that were changed. Load data into arrays before the search. The only import should be CSV. Use the following code sections when programming:
with open("C:/Users/le/csv/employees.csv") as csvfile:
file = csv.reader(csvfile)
for row in file:
ipaddress.append(record[0].split("."))
for i in range(0, len(ipaddress)):
print(ipaddress[i])
Example CSV File:
Paul,Roberts,555-912-5999,proberts@roadrunner.com,MIS,Tech Support Jason,Miller,555-241-1541,jmiller@roadrunner.com,Business,Accountant Megan,Doe,555-544-2222,mdoe@roadrunner.com,MIS,Helpdesk Michael,Johnson,555-681-8272,mjohnson@roadrunner.com,MIS,Tech Support Jean,Thompson,555-782-2851,jthompson@roadrunner.com,Business,HR
From the above example CSV file, Paul Roberts and Megan Doe would both need their e-mails changed to .net.
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