pls help me !! about text database shell programming


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting pls help me !! about text database shell programming
# 1  
Old 07-20-2007
Computer pls help me !! about text database shell programming

my teacher assigned me an assignment about text database shell programming but I don't know anything about that. here is about problem. I must submit this assignment to my teacher before 3 August. contact me at **deleted**, thank you

Given a text database file for student registration name 'reg.acc' with the following schema. Each record is separate with a line break and each field is separate with a colon (colon separated value).

Table Definition: (colon separated value)
NE:NT:ID:ME:MO:RN

Field Definition: (Field-Value Format)
NE: Name in English
NT: Name in Thai
ID: Student ID
EM: E-mail Address
MO: Mobile Phone Number
RN: Position of the Record Number.

You are to write a shell program 'reg.bash' that process a single table student registration text database.
You can use either ID or RN as search Key. That is Key=(ID|RN). Your program should support the
following operations:
AddRecord - Add the record to the table. The operation not include the RN field.
Usage: reg.bash AddRecord record-text
Example: reg.bash AddRecord Tom::12345678:tom@hotmail.com:0811234567
Find - Find the record using either the record number or student ID.
Usage: reg.bash Find Key Value
Example 1: reg.bash Find ID 12345678
Output: Tom::12345678:tom@hotmail.com:0811234567:5
Example 2: reg.bash Find RN 5
Output: Tom::12345678:tom@hotmail.com:0811234567:5
ViewDetail - View the detail of the record in the Field-Value Format
Usage: reg.bash ViewDetail Key Value # Key=(RN|ID)
Example reg.bash ViewDetail ID 12345678
Output: NE:Tom
NT:
ID:12345678
EM:tom@hotmail.com
MO: 0811234567
RN:5
ListAll - List all records in the table in a Colon Separated Value Format
ListAllDetail - List all records in the table in a Field-Value Format
Delete - Delete the record.
Usage: reg.bash Delete Key Value
Example 1: reg.bash Delete ID 12345678
Example 2: reg.bash Delete RN 5
Replace - Replace existing record
Usage: reg.bash Replace Key Value Record
Example 1: reg.bash Replace ID 12345678 Peter::12345678:tom@hotmail.com::5
Example 2: reg.bash Replace RN 5 Tony::12345678:tom@hotmail.com::5

Last edited by Ygor; 07-20-2007 at 11:33 PM.. Reason: Removed email address
# 2  
Old 07-20-2007
read the forum rules. No home work please !!!!!!
kamitsin
# 3  
Old 07-20-2007
Don't post your personal ids !

Don't post homework / class room assignment problems.

Please read the rules of the forum.

Moderators please Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

2. Shell Programming and Scripting

Color text on shell programming

hello i need the main reference for color code on shell programing i know a few color like: RED='\033 (2 Replies)
Discussion started by: nimafire
2 Replies

3. Programming

pls. help with SQL database...

On the Linux systems, we have scripts which monitor disk usage. I want to take that data and feed that into SQL database. Can you give some advise. For example here is one of the file. I have many files like this but the format is same... 2012-09-24 04:36:14 2012-09-24 04:36:16 48414984... (3 Replies)
Discussion started by: samnyc
3 Replies

4. Shell Programming and Scripting

Korn shell program to parse CSV text file and insert values into Oracle database

Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database. I need to write the korn shell program on Red Hat Enterprise Linux server. Oracle database is 10g. (15 Replies)
Discussion started by: shellguy
15 Replies

5. Shell Programming and Scripting

Programming Language good for standalone App with embedded Database

Hi, I would like to ask for someone more experience in programming, May i ask on where do i start or what langguage should i start inorder to create an APPS with nice GUI front end for visual display and a embedded Database in backend for records purposes, a stand alone apps, for example i want... (5 Replies)
Discussion started by: jao_madn
5 Replies

6. Shell Programming and Scripting

shell script, pls help

# for i in `cat oo`;do ls -ld $i;done ls: /var/tmp/i: No such file or directory ls: i: No such file or directory ls: /var/tmp/ii: No such file or directory ls: i: No such file or directory ls: /var/tmp/iii: No such file or directory ls: i: No such file or directory ls: /var/tmp/iiii: No such... (2 Replies)
Discussion started by: cpttak
2 Replies

7. Shell Programming and Scripting

A script pls( To retrieve database information)

KSH - Unix -AIX - db2 ************** Get the input from the user say '123' (It varies) Then i want to connect to a database say "D1" then i want th extract from the database by giving "select * from tablename where input = '123' I also want to connect to another database "D2" then i... (3 Replies)
Discussion started by: rollthecoin
3 Replies

8. Shell Programming and Scripting

Need Shell Script to upload data from Text file to Oracle database

Hi Does any one have any idea on uploading the data using Unix Shell script from text file to Oracle database. Requirement:- 1. Need to connect to Oracle database from Unix Shell script. 2. Need to pick Text file from some location on Unix Box. 3. Need to upload the data from text file to... (6 Replies)
Discussion started by: chandrashekharj
6 Replies

9. UNIX for Dummies Questions & Answers

extract some specific text file urgent pls

i have a big text file . i want to create new file as extract some specific text from the big file i am using hp ux please help (2 Replies)
Discussion started by: reyazan
2 Replies

10. UNIX for Dummies Questions & Answers

To Read a text file using shell Programming

Hello! I need to read a text file containing certains rows and columns!The following is a sample file with only three rows! 01:41:30:00:05:51 OFF 48506649K 5769415 63494357K 01:41:30:00:05:65 ON 4493546K 27266552 5880264K 01:41:30:00:05:78 OFF 614556K 89121 47291K... (1 Reply)
Discussion started by: sandytul
1 Replies
Login or Register to Ask a Question