![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|