The file consists of text with markup, or “tags” that tell how the text is to be displayed. An opening tag is a command enclosed in angle brackets < and >. For example, <para> means “start a paragraph”. The corresponding closing tag that means “end a paragraph” is written </para> (note the slash after the less than sign).
Here is the document that you will be modifying; just copy and paste it into a text file on your system.
<article> <title>About the Web</title>
<para> This is an article about the World Wide Web. The World Wide Web is a collection of documents that are linked to one another. The Web is <emphasis>not</emphasis> the same as the Internet. The Internet is a world-wide network of networks, and it does far more than simply serve up Web pages. </para>
<para>Tim Berners-Lee, the inventor of the World Wide Web, put special emphasis on the portability of web pages. Rather than create a proprietary format, he made Web pages dependent only upon plain ASCII text.</para>
<para> Web pages are written in a markup language called HTML. Here is what it looks like. The < and > mark off elements. </para>
<listing> <body> <div id=“top-navig”> <a id=“top”></a> <a href=“index.html”>ULI 101 Index</a> &gt; Assignment 1 </div>
<h1>Assignment 1</h1> <p>This exercise shows you how to use the two computer environments that you will use in this class. You will:</p> <ol class=“upper-roman”> <li>Set up your directories on Windows. This is where you will write your HTML documents.</li> </ol> </listing>
<para>It looks difficult, but it is possible to learn HTML in a few weeks. <emphasis>You, too can create web pages for viewing by friends and family!</emphasis> Note that, in our listing, we had to encode > as &gt. </para> </article> Write a sed file that does the following. It should work on any html or text file, not just this one. That means you can’t count on a particular tag always being on a particular line.
This is a <emphasis>great</emphasis> bargain. will become This is a *great* bargain.
Between the <listing> and </listing>, do these things (you must use curly braces to do this!):
Note: you must do these operations in the order shown above; otherwise, you will get the wrong results! Note: The & character is a special metacharacter when used in the “replacement” portion of a substitution. For example, if you want to replace the word “and” with “&”, you would do this:
Submit the commands and changed file
The following is contained is a text file called employee.txt:
100 Thomas Manager Sales $5,000
200 Jason Developer Technology $5,500
300 Sanjay Sysadmin Technology $7,000
400 Nisha Manager Marketing $9,500
500 Randy DBA Technology $6,000
Using awk, indicate what commands will accomplish the following:
Write down the commands with the sed submission
Total 2% Due December 6, 2018