subject

Write an awk script named extract. awk to extract a portion of the input file(s) as follows. somewhere after a line containing exactly the text "start from here", find the first line containing exactly 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]$ cat test0.txt
start from here
nextline
this is the one we want
not this one.
nor this one.
[user]$ extract. awk test0.txt
this is the one we want
[user]$ 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]$ extract. awk test1.txt
this should be displayed
[user]$ cat test2.txt
1
this file has no magic text
anywhere!
[user]$ extract. awk test2.txt
[user]$

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Write a grading program for a class with the following grading policies: a. there are two quizzes, each graded on the basis of 10 points. b. there is one midterm exam and one final exam, each graded on the basis of 100 points. c. the final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (do not forget to normalize the quiz scores. they should be converted to a percentage before they are averaged in.) any grade of 90 or more is an a, any grade of 80 or more (but less than 90) is a b, any grade of 70 or more (but less than 80) is a c, any grade of 60 or more (but less than 70) is a d, and any grade below 60 is an f. the program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s average numeric score for the entire course and final letter grade. define and use a structure for the student reco
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
You know the right answer?
Write an awk script named extract. awk to extract a portion of the input file(s) as follows. somewhe...
Questions
question
Physics, 03.02.2021 01:10
question
Mathematics, 03.02.2021 01:10
question
Chemistry, 03.02.2021 01:10
question
Mathematics, 03.02.2021 01:10
question
Mathematics, 03.02.2021 01:10
question
Business, 03.02.2021 01:10
question
Mathematics, 03.02.2021 01:10
question
Mathematics, 03.02.2021 01:10
Questions on the website: 13722367