Programming Homework Help

Programming Homework Help. its about awk

Your news server is now up and running and you wish to view a summary of the amount and type of news traffic being fed to your news server. In particular, for each feed site, you want to see how many articles were accepted, canceled, or rejected.

undefined

  • Make the following symbolic link in your assign3 directory using the following commands
  • The news distribution daemon, innd, will write one line for each article in the news file. This is a text file with a variable number of space-separated fields in one of the following formats:

undefined

mon dd hh:mm:ss.mmm + feed <Message-ID> site… mon dd hh:mm:ss.mmm j feed <Message-ID> site… mon dd hh:mm:ss.mmm c feed <Message-ID> site… mon dd hh:mm:ss.mmm – feed <Message-ID> site…

undefined

The first three fields are the date and time to millisecond resolution. The fifth field is the site that sent the article (based on its path header), and the sixth field is the article’s Message-ID; there will be a question mark if the information is not available.

undefined

The fourth field indicates whether the article was accepted or not. If it is a plus sign, then the article was accepted. If it is the letter “j” then the article was accepted but filed in the “junk” newsgroup. If the fourth field is the letter “c” then a cancel message was accepted before the original article arrived. In all three cases, the article has been accepted and the “site…” field contains a space-separated list of sites to which the article is being sent.

undefined

If the fourth field is a minus sign then the article was rejected.

undefined

  • Your news server has the following feeds:
    • The number of articles accepted from each site.
    • The number of articles rejected from each site.
    • The number of articles canceled from each site.
  • Because the news file is quite large, you may want to use sed to create a smaller file of approximately 1,000 lines on which to test your program.
  • This awk script’s filename should be titled as newsfeed.awk.

undefined

swrinde news.cais.net ?

undefined

4.Calculate the following information for each feed:

undefined

5.The date and time of the first entry as well as the last entry should also be printed. The news file represents one day of traffic.

undefined

8.The output should be formatted as closely as possible to the following:

undefined

Output of newsfeed.awk script

undefined

IncomingNewsFeed Summary

acceptedr e j e c t e dcanceled

swrinde : 94691119470 news . c a i s . net :143712400

?:303

StartTime = Feb1321:28:38.409End Time = Feb1420:56:49.066

undefined

1 2 3 4 5 6 7 8

undefined

Script Execution

undefined

Your scripts should be invoked directly via the command line, as seen in the following examples:

undefined

Example:

undefined

$ awk -f news.awk active > news.commands

undefined

$ awk -f newsfeed.awk news

undefined

Assignment Data

undefinedThe assignment input data files can be found at:
undefined

Your program should consist of exactly two files:

undefined

  • news.awk – awk script responsible for parsing and reformatting the active data file
  • newsfeed.awk – awk script responsible for parsing the news data file

Programming Homework Help

 
"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"