Page 1 of 1

Part 2: Practice Problem 1: Oman Tel has a list of clients saved in a text file with .txt extension. Each line of the te

Posted: Tue Apr 12, 2022 10:24 am
by answerhappygod
Part 2 Practice Problem 1 Oman Tel Has A List Of Clients Saved In A Text File With Txt Extension Each Line Of The Te 1
Part 2 Practice Problem 1 Oman Tel Has A List Of Clients Saved In A Text File With Txt Extension Each Line Of The Te 1 (29.84 KiB) Viewed 33 times
Part 2 Practice Problem 1 Oman Tel Has A List Of Clients Saved In A Text File With Txt Extension Each Line Of The Te 2
Part 2 Practice Problem 1 Oman Tel Has A List Of Clients Saved In A Text File With Txt Extension Each Line Of The Te 2 (43.14 KiB) Viewed 33 times
in python
Part 2: Practice Problem 1: Oman Tel has a list of clients saved in a text file with .txt extension. Each line of the text file is a record containing the name and telephone number of a given client, as shown in Figure 1. Ahmed Ali 99917329 Ali Ahmed 93001122 Othman Mohammad 77771234 Othman Nasser 772#3456 Othman Taleb 71734512 Amin Redha 939 9312 Amani Mohammed 90901234 Safa Kamel 92345610 Amira Khaled 9125679 Jawahir Moussa 7098761 Figure 1. List of clients with telephone numbers

OmanTel expects always phone numbers with incorrect formats. A phone number must contain exactly 8 digits without spaces or other special characters. What is requested here is • To read from the user name of the input file and make sure it's within the correct format(i.e. ends with "txt"). • To refine the list of clients in the input file by deleting all records with incorrect phone numbers and saving the updated list to a new text file as shown in Figure 2. • To name the new file to be like xxxx_update.txt, where xxxx is the old file name (i.e. if the original file name is clients.txt, the new file name will be clients update.txt). • To print the number of incorrect records. Ahmed Ali 99917329 Ali Ahmed 93001122 Othman Mohammad 77771234 Othman Taleb 71734512 Amani Mohammed 90901234 Safa Kamel 92345610 Deleted records 4 Figure 2. Updated list of clients with telephone number