![]() |
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 |
| Shell script to search for text in a file and copy file | imeadows | UNIX for Dummies Questions & Answers | 9 | 11-12-2008 09:12 PM |
| shell script to read data from text file and to load it into a table in TOAD | pallavishetty | Shell Programming and Scripting | 1 | 10-31-2008 04:15 AM |
| Shell script for text extraction from a file | vignesh53 | Shell Programming and Scripting | 3 | 02-05-2008 08:16 AM |
| Need Shell Script to upload data from Text file to Oracle database | chandrashekharj | Shell Programming and Scripting | 6 | 03-26-2007 03:21 AM |
| Shell Script to Load data into the database using a .csv file and .ctl file | Csmani | Shell Programming and Scripting | 3 | 05-24-2006 08:09 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Using Shell Script to get data from text file
Hello, I have got the script below that reads a text file and then extract data from the third column and then send the result to another shell scrpt call tsim - the script works fine.
The problem I am having is that I want the user to enter the 'Test Day' which the first column in the text file, and depending on the Test Day entered (in this case 1, 2 or 4) the script will extract first instance of the required data from the related line, send the fist set of data to the tsim scrpt and then move on to the next.....CAN ANYONE HELP PLEASE -----Current Script-------------------- #!/bin/sh Please enter the Test Day - Enter 0 for all : " read x ( read a b c d < LottWagers2.txt IFS=- printf ' 1\n 20\n 0\n 0\n 1\n 1\n 7\n 0\n' printf ' %s\n' $c printf ' 1\n 1\n 0\n 0\n 0\n N\n 1\n 100\n' ) | "$LOTO"/bin/loto_tsim > /dev/null 2>&1 -------------------------------------------------- -----------text file content----------------------- 1 1 01-02-25-26-27-28 (99) Both 1 1 1 26-27-28-29-30-31 (31) Both 1 1 1 01-02-27-28-29-30 (99) Both 1 2 1 01-31-32-33-34-35 (99) Both 3 2 1 01-06-09-10-20-21 (99) Both 3 4 1 05-07-08-09-10-25 (99) Both 4 4 1 01-02-10-11-24-25 (99) Both 7 4 1 01-02-31-32-33-34 (99) Both 5 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|