The Directory.txt file contains names of the employees ar

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
The Directory.txt file contains names of the employees and their phone numbers in the following order.
Last name, First name, Phone.
The creator of this file made several mistakes by typing commas and dots inconsistently.
Write a Python program to read this file and produce an output file with the name DirectoryNew.txt. This file should fomat the phone directory as
follows:
Phone
First name
Number 1
First name 1
Number 2
First name 2
The file MUST end with:
########## End of directory ##########
Transcribed Image Text:The Directory.txt file contains names of the employees and their phone numbers in the following order. Last name, First name, Phone. The creator of this file made several mistakes by typing commas and dots inconsistently. Write a Python program to read this file and produce an output file with the name DirectoryNew.txt. This file should fomat the phone directory as follows: Phone First name Number 1 First name 1 Number 2 First name 2 The file MUST end with: ########## End of directory ##########
Content of the input file
Springsteen, Bruce, 2587.
Hassan, Amir, 6958.
Homes, Rebecca, 5263
Smith, John, 5252
MacDonald, Mirna, 89651
Pichai, Sundar, 9632.
Jobs, Steve, 1002
Goldsmith, Micheal, 5478.
Yassir, Ammar, 8885
Nicholas, Jack, 4696
Pang, Chee, 9898
Lee, Andrew, 7412.
Jimenez, Dragos, 6547
Edit Metadata
The output should be as follows
Phone
First name
2587
Bruce
6958
Amir
5263
Rebecca
5252
John
8965
Mirna
9632
Sundar
1002
Steve
5478
Micheal
8885
Ammar
4696
Jack
9898
Chee
7412
Andrew
6547
Dragos
########## End of directory ##########
Transcribed Image Text:Content of the input file Springsteen, Bruce, 2587. Hassan, Amir, 6958. Homes, Rebecca, 5263 Smith, John, 5252 MacDonald, Mirna, 89651 Pichai, Sundar, 9632. Jobs, Steve, 1002 Goldsmith, Micheal, 5478. Yassir, Ammar, 8885 Nicholas, Jack, 4696 Pang, Chee, 9898 Lee, Andrew, 7412. Jimenez, Dragos, 6547 Edit Metadata The output should be as follows Phone First name 2587 Bruce 6958 Amir 5263 Rebecca 5252 John 8965 Mirna 9632 Sundar 1002 Steve 5478 Micheal 8885 Ammar 4696 Jack 9898 Chee 7412 Andrew 6547 Dragos ########## End of directory ##########
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Header Files
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education