The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to insert data into MYSql database from a text file shirleyeow Shell Programming and Scripting 4 01-11-2008 05:00 AM
Need Shell Script to upload data from Text file to Oracle database chandrashekharj Shell Programming and Scripting 6 03-26-2007 04:21 AM
how to insert data in database based on text file? forevercalz Shell Programming and Scripting 9 12-20-2005 11:40 PM
shell programming Neha Agarwal Shell Programming and Scripting 2 09-07-2005 03:23 AM
To Read a text file using shell Programming sandytul UNIX for Dummies Questions & Answers 1 04-11-2001 12:15 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-20-2007
sunattha sunattha is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 1
Talking 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0