03-04-2009
1,
0
Join Date: Mar 2009
Last Activity: 5 March 2009, 4:15 AM EST
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
scripting for classification
hi i am very new to scripting. i am learning by myself. i found this example. can any one help in writing script for this example, so that i can have an idea how to analyse and script.
example:
overview: The aim of this exercise is to classify books into four seperate files and then print a summary report.
specification:
The books records are stored in one csv file and the layout and the contents are contained in aPPENDIX 1.
There are four categories of books: sports, computing, children's and horror. You will need to determine the category and then write a series of 3 records to the appropiate file. The files need to be created in your program and their names will be: children_books, horror_books, sports_books and computing_books. They will be stored in a directory calles $HOME/tutorial. The format of four files is contained in Appendix 2.
Records which do not belong to any of the above categories should be printed to the screen as an error.
The summary report will be displayed on the screen and will contain the following information:
- Date
- names of files created (including path name)
- total number of bokks processed
- total value of books
******************************
Appendix 1 - CSV File sample
ISBN, Title, Category, cost, NO of copies
978-0340681138, Five Get into TRouble (Famous Five), Enid Blyton, Childrens, 6, 3
978-0142301883, The Little Match Girl, Hans Christian Anderson, Childrens, 3, 2
978-0304921532, cell, Stephen King, Horror, 7, 1
978-0596100292, Unix in a Nutshell Scripting, Arnold Robbins, Computing, 17, 2
****************
Appendix 2 - Format of output files
ISBN: 978-0340681138
Author: Enid Blyton
Title: Five Get into Trouble (Famous Five)
Thanks in advance