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. Nrite a Python program to read this file and produce an output file with the name DirectoryNew.txt. This file should format 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 Edit Metadata
Q: You will create a new version of the restaurant ordering program you created below in which the…
A: I have used "menu.txt" for the menu items as opposed to the predefined lists. def…
Q: In Python Prompt the user for a text file that contains a list of student names, one on each line.…
A: NOTE: Follow proper indentation. sample data not given in the question. so, random data considered…
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Run a python program that will receive a chemical compound formula as an input and will give its…
A: The mass.csv file is read using the csv module, which is imported in the code. The with statement is…
Q: Suppose you are given a text file named "input". The file includes 100 lines. Each line of the file-…
A: Based on Java
Q: In the game of scrabble, each letter is associated with a number of points. It is these points that…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: In python please Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines.…
A: Given: In python please Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100…
Q: Write a python program that will ask the user for their grocery list, one item at a time, and will…
A: here in given question ask for write program in python as per question staatement.
Q: Write a program that does the following: Reads information from a text file into a list of…
A: Actually, the code has given below:
Q: Follow these steps: ● Create a new Python file in this folder called replace.py. ● Save the…
A: The PYTHON program is given below with code and output screenshot string[: :-1] is used to reverse…
Q: Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines. 2. Each line in…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Problem: Write a Python program that reads from an input file named employees.txt some employee…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.…
Q: In Python Take the Deck of cards we created in Problem Solving Exercise: Shuffle and Deal Cards and…
A: Note: we had provided answer according to given hints provided in solution parts.
Q: Read a text file and displays its contents on the screen., but replace every 'h' character it finds…
A: sample output
Q: Write a java program to read from the Keyboard name of the item and its price until the user Enter…
A: Step 1 : Start Step 2 : In the main method , declare the array of strings to store the item names…
Q: A company stores payment information for their employee working on a project and paid on a project…
A: In question, you have said that the .txt file's first line will indicate the number of employees but…
Q: Rercise 3: A company stores payment information for their employee working on a project and paid on…
A: 61 answers Python Code: try: f = open('myfile.txt', 'r') except IOError: raise IOError("Error:…
Q: In this assignment, you will create a Java program to read undergraduate and graduate students from…
A: Code:- StudentIDComparator.java import java.util.ArrayList;import java.util.Collections;import…
Q: Below this question is a generated text representing a DNA sequence. The first line starts with '>'…
A: The algorithm steps to write the given function gcContent(sequence) are given below:- First, count…
Q: Modify task1.c so it will read from standard input, convert lowercase letters to uppercase letters,…
A: C program, read from standard input converting lowercase into uppercase letter and write standars…
Q: Please answer it in Python In the game of scrabble, each letter is associated with a number of…
A: Hey there, I am writing the required solution of the above stated question.Please do find the…
Q: Q. Write a python program that creates an excel file containing Student Record: Roll No.,Name, Marks…
A: GIVEN: A python program that creates an excel file containing Student Record:Roll No.,Name, Marks…
Q: Problem: Write a Python program that reads from an input file named employees.txt some employee…
A: Using python 2.7 def printHeader():print…
Q: Write a program that will read a file from the user and writes its content in another file such that…
A: required: Write a program that will read a file from the user and writes its content in another file…
Q: This is a Python program Reads information from a text file into a list of sublists. Be sure to…
A: A require program is as follows, import datetime import os # Define a function that returns a list…
Q: Python Run an object oriented python program that will guess for a person’s age based on their…
A: Ans:) In this program we follow the below approach: read data line by line and create a person…
Q: A company stores payment information for their employee working on a project and paid on a project…
A: We have to write a python program that is as follows:-
Q: Write a python program that does the following: Reads information from a text file into a list of…
A: Actually, the code has given below:
Q: Write a Python program that reads from the user the name of two files (an input file and an output…
A: code :-- # getting the input an output file name from user file_in = input('Enter input file name :…
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: A file named gang.txt is shown below. Write Python code that opens this file, reads only the first…
A: def file_read_from_head(fname, nlines): from itertools import islice…
Q: Exercise 1: Write a python program that reads from a text file whose name is provided by the user…
A: from os import pathfile_name=input("enter file name: ")if(path.exists(file_name)): #checking if file…
Q: In a python program, create a new file and call it “ tracking”. Write to it four lines each contains…
A: Python Code for the above Question is given below
Q: In python: The file contain the content in the form pet1,pet2,pet3 Output will return [[‘pet1’,…
A: Here I have created a function named read_file(). In this function, I have opened the file in read…
Q: In Java A comma separated value (.csv) file has been included to be used for this program. Each…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: File sourceFolder, String filename
A: Answer: Note: Done accordingly. Please comment for any problem. Please Uprate. Thanks Code: package…
Q: The name should be able to be sorted last name first. Profession should be able to be sorted…
A: q: The name should be able to be sorted last name first. Profession should be able to be sorted…
Q: It contains data for one movie on each line. Each Movie contains the following data items:…
A: Program firstly gets the local directoty path. The source file path has been stored into a variable…
Q: In Java Oleae nust read a file A photographer is organizing a photo collection about the national…
A: Actually, Java is a general-purpose also class-based, object-oriented programming language designed…
Q: In Python, Use number.txt file (below). create a program that opens num.txt, a file consisting of a…
A: The above question is solved in step 2 :-
Q: Given a text file containing the availability of food items, write a program that reads the…
A: Here is the python code: See below step for code. Foot.txt
Q: Write a python program that will ask the user for their grocery list, one item at a time, and will…
A: Answer:
Q: Python Code: Below is an open link to file needed in this program Spots:…
A: Code: import numpy as npimport matplotlib.pyplot as plt # opening file in read…
Q: Assume a text file named “myNumbers.txt” contains integers separated by a new line. Using Repl.it,…
A: To solve the given problem you need to read a text file and then perform the calculation to get…
Q: This is a python file Fix this code and the output is the attachment #filename:…
A: You have used “from modValidateEmail import *” and this is not a module in python library and there…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: The Answer start from step-2.
Q: reads in a file of student academic credit data. Each line of the input file will contain the…
A: Programming is instructing a computer to do something for you with the help of a programming…
python 3
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- The Directir file contains namés línhe 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 format 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 Edit Metadata Edit Metadata Content of the input file The output should be as follows Springsteen, Bruce, 2587. Hassan, Amir, 6958. Phone First name Homes, Rebecca, 5263 Smith, John, 5252 MacDonald, Mirna, 8965! Pichai, Sundar, 9632. Jobs, Steve, 1002 2587 Bruce 6958 Amir 5263 Rebecca 5252 John 8965 Mirna 9632 1002 Goldsmith, Micheal, 5478. Sundar Yassir, Ammar, 8885 Steve Nicholas, Jack, 4696 5478 Micheal 8885 Pang, Chee, 9898 Lee, Andrew, 7412. Jimenez, Dragos, 6547 Ammar 4696 Jack 9898 Chee 7412 Andrew 6547 Dragos…Code should be in Python. A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. (Examples in image)7412 Andrew 6547 Dragos # Bnd of directory ### # Edt Metadata [2]: M ** This function is used to generate the input file directory.txt a* Run this cell to gererate the file. def generateinputFile(): try: lines-['Springsteen, Bruce, 2587. \n', Hassan, Aair, 69sa. \n', Homes, Rebecca, 5263n, *Smith, John, 5252n, MacDonald, Mirna, 89651 \n, Pichai, Sundar, 9632. \n, Jobs, steve, 1002 \n, Goldsmith, Hicheal, 5478. n, Yassir, Ammar, BSES \n, Nicholas, Jack, 4G96\n','Pang, Chee, 9a98n, Lee, Andrew, 7412. \n, *imenez, Dragos, 6547\n] outfile open ("Directory,txt","w) for line in lines: outfile.write(1ine) except Exception as ext print (ex) finally: outfile.close() generateinputFile() Edt Metadata In M writefile Hito1. py R MComment the above (ine after you finish your code, in order to generite the Python subwission file.
- PLEASE COMMENT CODE In a python program, create a new file and call it “ tracking”. Write to it four lines each contains information about an order like this: 1-00654-021 Dell charger Toronto-WEST 99-49-ZAD011-76540-022 ASUS battery Milton-EAST 34-56-CBH561-09239-026 HP HD Scarborough-NORTH 12-98-AZC451-12349-029 Mac FD North York-LAWRENCE 34-49-ZWL01Add the file two more lines: 1-34567-055 Lenovo SSD Milton-ON 34-09-MT04 1-90432-091 Lenovo battery Oakville-ON 78-KL98 Define a function that searches for a brand (e.g. Dell, ASUS, etc.). Test the function in your program.PYTHON: Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt. Output one student per row…Create a program in C language for reading and writing student records. Submit all necessary source codes and files to run this program (it is recommended to compress all files and submit a single file). First create text file "student_records.txt". The file should look like: Name Surname Quiz 1 Quiz 2 Quiz 3 Ada Lovelace 93 88 97 Babbage Turing Нopper Charles 26 80 70 Alan 74 85 92 Grace 99 87 100 a. Read the file contents and load them into an array of Record structs. b. The record struct has the member variables: o char array name o char array surname o int quiz_1 o int quiz_2 o int quiz_3 c. Write a function that calculates a students quiz average. The function takes a Record struct and returns a double. d. Create two new records for students inside your main program. e. Create a new text file with the new records to a a file called "student_records_new.txt"
- In Python Write a program that consists of (at least) two function: A function that creates and saves data in a file. The saved data represents exam grades. In the function, you will create n random numbers in the range [0,100], where n is the number of students. The function can be called as follows: createFile(filename, n) Main function, in which the user inputs the file name and the number of students, then the main calls function createFile. The main should perform validation for n (should be > 0), and the filename (should end with .txt). I will explain how to validate strings in the coming lecture. Hint: a good developer will write four functions to solve the problem.Code should be in Python. Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate lists, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character ('\t'). (Examples in image)A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg AmericanSamoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg GrandCanyon1996_photo.jpg IndianaDunes1987_photo.jpg LakeClark2009_photo.jpg Redwood1980_photo.jpg…
- A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txtand the contents of ParkPhotos.txt are:…IN PYTHON Problem Statement Given a text file of Zoom users wanting to attend a meeting, filter out a list of users with the domain name @my.fltech.com or @fltech.edu. Then print the list with names (last name, first name) of those with authenticated tech email. Print one name in each new line. Note: the file name is not given by "input()". Instead, assume a file named "zoom_attendees.csv" is available that you need to open/use. Sample Input: zoom_attendees.csv Jackson,Thompson,jackson.thompson@fltech.edu Mines,mines,luke.wallace@lycos.com David,Wright,david.wright@fltech.edu Nathaniel,Butler,nathaniel.butler@aol.com Sample Output Thompson, Jackson Wright, DavidIn python please Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines. 2. Each line in the file consists of a faculty:a. First nameb. Last namec. Rankd. Salary 3. For the first and last name use:ith line FirstNamei and LastNamei 4. The rank is randomly generated as assistant, associate, and full. 5. The salary is randomly generated as a number with two digits after the decimal point. a. Assistant Professor 50,000 – 80,000b. Associate Professor 60,000 – 110,000c. Full Professor 75,000 – 130,000 6. Sample data:FirstName1 LastName1 assistant 59125.75 FirstName2 LastName2 full 112800.25...FirstName100 LastName100 associate 89355.23 7. Using salary.txt that you created, write a program to display the following: a. Total salary for assistant professor, associate professor, and full professor b. Average salary for each.