Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A) B) Write the same program, but in a sed script. Write an auk script named ext

ID: 3604267 • Letter: A

Question

A)

B) Write the same program, but in a sed script.

Write an auk script named extract.auk to extract a portion of the input file(s) as follows. Somewhere after a line containing eractly the text "START FROM HERE", find the first line containing eractly the text "NEXTLINE" and display the following line. No other lines should be displayed. If the specific lines are not present, then the script should display nothing. For example: user]S cat test0.txt START FROM HERE NEXTLINE This isl the one we want Not this one Nor this one user]S extract.auk test0.txt This is the one we want user]S cat test1.txt Ignore everything up here NEXTLINE Ignore these lines also because we did not see the first magic line yet START FROM HERE More lines to ignore NEXTLINE This should be displayed This should not NEXTLINE This is too late so do not display it START FROM HERE Only the first occurrence matters so NEXTLINE None of this will be displayed either user]S extract.auk test1.txt This should be displayed

Explanation / Answer

import java.io.File; importjava.io.IOException; public class RenameFile { public static void main(String[] args) { try // Here F is the object of the Existing file named with Includehelp which is to be renamed. // { File F=new File("f:/Includehelp.txt"); // Here T is the object of the renamed file of Includehelp which is Include.txt. // File T=new File ("f:/Include.txt"); // Rename the file Includehelp.txt into Include.txt. // F.renameTo(T); // Print the result if file renamed. // System.out.println("File Rename Successfully..."); } // If any error occurs while renaming the file. // catch(Exception e) { System.out.println(e); } } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote