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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:00, lgary9462
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass. cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array. c . run this program and observe the results.
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, abelxoconda
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
image
Computers and Technology, 23.06.2019 21:40, minnie7760
Draw the resistor’s voltage and current phasors at t=15ms. draw the vectors with their tails at the origin. the orientation of your vectors will be graded. the exact length of your vectors will not be graded.
Answers: 2
image
Computers and Technology, 24.06.2019 07:40, daebreonnakelly
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
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 in other subjects:

Konu
Mathematics, 15.01.2020 17:31