Question: You are creating a program that opens and reads a file. Your program opens a file that a filename is entered by a user. A

You are creating a program that opens and reads aYou are creating a program that opens and reads a

You are creating a program that opens and reads a file. Your program opens a file that a filename is entered by a user. A filename that does not exist produces an error message: "File does not exist". Once a correct filename is entered your program will read the file and extract all the "From" lines. The "From" is in the first column of the file. Download the input file test_file.txt from Files/Data Files. Write a program that: Prompts a user to enter an input file name. Errors off when the wrong file name is entered. Opens a file when the correct name is entered. Reads each line of the file. If you read a record (line) with a "From" in the first 4 columns write it to an output file. Display the number of records in the output file as the last entry in the output file. Close the output file. Example of Input File From stephen marquard@uct.ac.za Sat Jan 5 09:14:16 2008 Return-Path: <41 pm><41 pm>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!