Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Reading a file and Classification Post 302294018 by yarlagadda999 on Wednesday 4th of March 2009 09:47:34 AM
Old 03-04-2009
Question Reading a file and Classification

Hello Everyone,

I am new to UNIX. I have got a requirement. Thought of posting it in this forum so that someone might help me. Please have a look at the scenario.

The Objective is to "classify books into four seperate files and then print a summary report".

Specifications are as follows:-

The books records are stored in one csv file and the layout and the contents are contained in File 1.
There are four categories of books: sports, computing, children's and horror. We should determine the category and then write a series of 3 records to the appropiate file.
The files need to be created in the program and their names will be: children, horror, sports and computing. The format of four files is contained in File 2.

Records which do not belong to any of the above categories should be printed to the screen as an error.

The summary report should be displayed on the screen and will contain the following information:
- Date
- names of files created (including path name)
- total number of boks processed
- total value of books

File 1 - CSV File sample
Code:
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

File 2 - Format of output files
Code:
ISBN: 978-0340681138
Author: Enid Blyton
Title: Five Get into Trouble (Famous Five)

Could anyone give me some idea about how to achieve this requirement as I am a bit new to programming. I would appreciate your help.

Regards,
Yarlagadda.

Last edited by Yogesh Sawant; 04-01-2009 at 01:13 PM.. Reason: added code tags
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating a Classification Banner

Hello; I need to place a classification banner at the top of my Solaris 2.6 CDE Desktop. The Banner must be displayed in all CDE desktop sessions available on the CDE dashboard (1,2,3,4). The Banner must remain anchored at the top of the CDE desktop and must not be able to be closed... (1 Reply)
Discussion started by: rambo15
1 Replies

2. UNIX Desktop Questions & Answers

CDE Classification Banner

Hello; I need to place a classification banner at the top of my Solaris 2.6 CDE Desktop. The Banner must be displayed in all CDE desktop sessions available on the CDE dashboard (1,2,3,4). The Banner must remain anchored at the top of the CDE desktop and must not be able to be closed or hidden... (0 Replies)
Discussion started by: rambo15
0 Replies

3. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: yonex
1 Replies
otest(1)						    BSD General Commands Manual 						  otest(1)

NAME
otest -- SenTestingKit, OCUnit. SYNOPSIS
otest [-SenTest Self | All | None | <TestCaseClassName/testMethodName>] path DESCRIPTION
otest runs the unit tests found in the bundle given at path. ARGUMENTS
-SenTest value This flag denotes the scope of the unit test to be run. Possible values are Self, All, None and <TestCaseClassName/test- MethodName>. The default value is Self. path Path to the bundle that contains the unit tests. OBJECTIVE-C GARBAGE COLLECTION otest is built with support for Objective-C garbage collection. Due to the "whole process" nature of Objective-C garbage collection, invok- ing otest from the command line or an IDE or debugger will run otest with garbage collection enabled. Doing so requires that the bundle con- taining the unit tests also be built with support for garbage collection. To avoid this requirement and disable garbage collection, run otest in an environment with the OBJC_DISABLE_GC environment variable set to YES. ENVIRONMENT
OBJC_DISABLE_GC Set to YES to disable Objective-C garbage collection for otest when running test bundles that do not use it. FILES
/Developer/Tools/RunTargetUnitTests A script that calls otest with the correct arguments for use with Xcode. SEE ALSO
RunTargetUnitTests(1), otest(1) Xcode June 2, 2019 Xcode
All times are GMT -4. The time now is 08:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy