Write a program that removes all the occurrences of a specifiedstring from a text file. For example, invokingjava Exercise12_11 John filenameremoves the string John from the specified file. Your program should get thearguments from the command line.
Q: Write a program that reads in words from a file and prompts the user for another word. Print the…
A: // word, to be searched in a file string word; Then, find out the longest word from the…
Q: Write a program that allows the user to create and maintain a list of contacts in a file named…
A: Answer: I have done code in C++ . and also I have attached code as well as code screenshot.
Q: remove all the occurrences of a specified string from a text file. In Python
A: Algorithm: Step 1: Start Step 2:. INPUT a string Step 3: INPUT character to remove its occurrence…
Q: Write a program that allows the user to create and maintain a list of contacts in a file contact…
A: Code: #include <iostream>#include <fstream> using namespace std; void printList() {…
Q: Write a program that allows the user to create and maintain a list of contacts in a file named…
A: Actually, program is an executable software that runs on a computer.
Q: Does the class FileOutputStream have a constructor that accepts a filename as an argument?
A: Does the class FileOutputStream have a constructor that accepts a filename as an argument?
Q: What will be the command to substitute a word W with another word WW in a file having n lines.…
A: The problem is based on the basics of file manipulations in bash.
Q: Write a program to read two file names from the command line. If the number of arguments in the…
A: When we passed arguments to the main function is called Command-Line arguments. The command-line…
Q: Write a program that replaces each line of a file with its reverse. For example, if you run java…
A: Program description: The main objective of the Reverse.java file is to read a java file,…
Q: Write a program called ReverseText.exe that takes two file names as command-line arguments. The…
A: In this C program, I have created a function that will read the first file and append the content…
Q: Write a program that asks the user how many words they would like to write to a file, and then asks…
A: the code for the above program is
Q: write a batch file for windows to sort a table by column from a text file. The user will be able…
A: The following is the code to sort the file. echo "Sort the file by column: " echo "choose from…
Q: Write a program that opens a file me.txt and write your first name followed by a space followed by…
A: The program has been written in python language.
Q: Write a program that asks the user for the name of a text file. The program should display the last…
A: Lets see the solution.
Q: Write a program that prompts the user to enter a text file, reads words from the file, and displays…
A: Given: program that prompts the user to enter a text file, reads words from the file, and displays…
Q: Write a program that reads a text file and creates another file that is identical expect that every…
A: Below program that reads a text file and creates another file that is identical expects that every…
Q: Write a program that first reads in the name of an input file, followed by two strings representing…
A: Code:
Q: Write a program that reads the attached file called input.txt , and creates an output.txt file that…
A: Here I have opened 2 files, input.txt in read mode and output.txt in write mode. Next, I have read…
Q: Write a program that first reads in the name of an input file, followed by two strings representing…
A: Solution:: Python code :: #Taking inputs from the user file_name=input("Enter the Path and name…
Q: Suppose that the name of a file in a computer directory consists of three digits followed by two…
A: The solution for the above given question is given below:
Q: Write a program that removes all the occurrences of a specified string from a text file. For…
A: This program is done with java file operations. So initially reading the file arguments from the…
Q: Write a program that removes all the occurrences of a specified string from a text file.Removes the…
A: let us see the code you haven't specified the language so I have written this code in C++
Q: Write a program that merges lines alternately from two files and writes the results to new file. If…
A:
Q: Write a program that reads each word from the attached text file (words_for_homework.txt) and writes…
A: 1. Create a new project in netbeans 2. Create new java file called Main.java 3. Copy and paste the…
Q: Write a program to write a pattern into a new file (result.txt) as shown below (6 rows of "*" ), the…
A: The solution to the given problem is below. **Note: As programing language is not mentioned in the…
Q: Write a program that first reads in the name of an input file, followed by two strings representing…
A: EXPLANATION: Create a text file txt that contains the given strings (alphabetically arranged).…
Q: Write a complete program that prints out the list of files in the current directory, along with…
A: Source Code: import os import time import sys def files(): #an empty list for storing files…
Q: Write a program in python language using basics that takes multiple student marks as input. If a…
A: Use an infinite loop to accept input from user and exit from loop if the user input marks is…
Q: Write a program that asks the user to enter her name, age, favorite color, and favorite food. Have…
A: Python used to answer this question
Q: Write a program that replaces each line of a file with its reverse. For example, if you run java…
A: The required java program is provided below in the next step.
Q: Write a Python program that reads each line of an input file temperatures.txt that consists of a…
A: inputfile=open('temperatures.txt','r') #Opening the temperatures.txt…
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: Create a objects of input and output file. Then read input file name Then open input file using…
Q: Write a program that finds all occurrences of a word in all the filesunder a directory, recursively.…
A: Program: //include the required header files import java.io.*; import java.util.Scanner;…
Q: Write a program that creates the file "LetterGrades.txt" filled with 1000 randomly generated letter…
A: import random def main(): #create variable for file name fileName = 'LetterGrades.txt'…
Q: Write a program that allows the user to create and maintain a list of contacts in a file named…
A: Actually, program is an executable software that runs on a computer.
Q: Write a program that meets the followingrequirements:■■ Get an audio file from the class directory…
A: Program approach Import required classes from JavaFX packages. Create a class PlayAudio that…
Q: Write a program that readswords from a text file and displays all the words (duplicates allowed)…
A: PROGRAM: //Header files import java.io.*; import java.util.*; //Defining the class class Main {…
Q: Write a program that first reads in the name of a input file, followed by two strings representing…
A: Program approach: Input filename, lower bound, and upper bound. Read all lines in the file via…
Q: Write a Java GUI program using BufferedReader that asks the user to input the file to be opened. If…
A: import javax.swing.*; import java.awt.event.*;import java.awt.*;import java.io.*;public class…
Q: Write a program that prompts for a file name, then opens that file and reads through the file…
A: We have to program a prompt file name, open that file, read through the file. Python Program def…
Q: Write a program that reads words from a text file and displays all the words (duplicates are not…
A: Please find the code below::: SortWords.java package fileIO; import java.io.File;import…
Q: Write a program that opens a specified text file and then displays a list of all the unique words…
A: Programming language is missing in the question. So we will answer this program in Python. If you…
Q: Write a program that prompts the user to enter afile name and displays the occurrences of each…
A: Since programming language is not mentioned in the question, we will answer this question in the…
Q: Write a program that will count the number of characters, words, and lines in a file. Words are…
A: Write a program that will count the number of characters, words, and lines in a file. Words are…
Q: Write a program in a single file that: Main: Creates 10 random doubles, all between 1 and 11, Calls…
A: Create an object for a file. Declare an array to store the random numbers of type double. Take a…
Write a
string from a text file. For example, invoking
java Exercise12_11 John filename
removes the string John from the specified file. Your program should get the
arguments from the command line.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images
- IN JAVA ONLY PLEASE. POSITIVE REVIEW WILL BE LEFT FOR CORRECT LANGUAGE ONLY AND NOT COPY PASTE FROM INCORRECT ANSWER 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…Create a text file of names, (3 names per line, 5 lines in total) followed by an age for each name. Go through the file and sum the ages. Create an output file with each persons name followed by age and then a line at the end of the output file that says “sum of all ages is: x”. Simple Java programming. Should include things like bufferedReader, fileReader, printWriter, fileWriter, file close, try-with-resources, Scanner, catch/try, etc. Include Java file and txt file. Thank you.write a program with python that asks the user to enter two filenames. One filecontains a list of words that you want to count. For the following explanation, let’s call it words.txt.(When your program runs, the user could type a different name. Do not hardcode any filenames inyour code.) The second file contains the text that you want to search for each word. For theexplanation, let’s call it story.txt.Ask the user to enter the name of each file. Assume that the files are located in the same directoryas your code file.For each word in words.txt, search through story.txt and count how many times the word occurs.Print a summary similar to the sample output below.Note 1: You should consider a “word” to be anything bounded by whitespace. You do not need todo any processing to account for punctuation or other special characters. For example, in thesample below, “time.” (with a period) is not considered the same as the word “time” (without aperiod). Capitalization will also matter. “The”…
- Write a program in Python that reads student information from a text file, then creates a text file that records the course grades of the students and a final grade. Each row of the .txt file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student, each separated by a space. A sample of the student information is provided in StudentInfo.txt below. 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 .txt file from the user. • Open the .txt file and read the student information using readline() or readlines(). • 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 • Output the first names, last names, exam scores, and letter grades of the students into a text file named…Write a program that reads student information from a text file, then creates a text file that records the course grades of the students and a final grade. Each row of the .txt file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student, each separated by a space. A sample of the student information is provided in StudentInfo.txt below. 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 .txt file from the user. • Open the .txt file and read the student information using readline() or readlines(). • 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 • Output the first names, last names, exam scores, and letter…When texting or tweeting, it’s not uncommon to shorten words to save time or space, as by omitting vowels, much like Twitter was originally called twttr. In a file called twttr.py, implement a program that prompts the user for a str of text and then outputs that same text but with all vowels (A, E, I, O, and U) omitted, whether inputted in uppercase or lowercase. USE PYTHON PLEASE SEE IMAGE FOR MORE DETAILS. THANKS.
- Write a program that opens a file me.txt and write your first name followed by a space followed by your last name, then your major on the second line. If the file does not exist, create it. If the file exists, have the file's contents be erased before writing your name. Be sure to close the file after. Example: Barack Obama Political Science Majorwrite a program that will open a file called “story.txt”and count the number of occurrences of each letter from the alphabet in this file.At the end your program will output the following report:Number of occurrences for the alphabets:a was used – times.b was used – times.c was used – times…. …and so, onAssume the file contains only lower-case letters and for simplicity just a singleparagraph. Your program should keep a counter associated with each letter of thealphabet (26 counters) [Hint: Use array]Your program should also print a histogram of characters count by addinga new function print Histogram (int counters []). This function receives thecounters from the previous task and instead of printing the number of times eachcharacter was used, prints a histogram of the counters. An example histogram forthree letters is shown below) [Hint: Use the extended asci character 254]:Build a csharp application that reads from a file and print out the contents of that file in another files words by words (i.e. one word each line)
- For this part in the assignment, you need to write a program in python that removes allinstances of a target element in a file named inputFile.txt. The user must enter the instance thatyou need to remove from that file. Once you received that instance, you need to check all thecontent in the inputFile.txt and remove that word. The result will be saved in another file calledoutputFile.txt. For example, if you received that the user wants to remove the word “and”, youneed to identify all the matches and remove them in the outputFile.txt document.Requirements: You should create the content in the inputFile.txt, please make them at leastwith ten lines or more. You could include poems, lyrics, news, etc. It is up to you. Also, youmust use functions to solve this part in the assignmentYou are a cyber investigator, your task is to write a python program that can read file signatures from a file and save them into a list. Each file signature is an element of your list. Then, try to find out if there is a JPG file in there. If there is a JPG file, print out a True on screen. (File Signature for JPG file is: FF D8 FF DB) The input file is: FSCS360_Midterm_Exam_Part2.txtWrite a program that reads the scores from numbers.txt a line at a time and displays their total and average. Since you don’t know how many scores, you will need to keep looping until readline is blank. num.txt is a file that contains a list of scores. num.txt 10 25 36 45 89 42 54 create a program that reads the scores from num.txt file one line at a time. The program should display their total and average. since the number of scores is unknown, the program must keep looping until readline is blank. Sample Output: There are 7 scores The total is 301 The average is 43.0