![]() |
|
|
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 |
| Searching filenames containing certain text??? | skyineyes | UNIX for Advanced & Expert Users | 6 | 01-16-2008 07:48 AM |
| Search for strings & copy to new file | amitrajvarma | Shell Programming and Scripting | 2 | 11-25-2007 11:51 PM |
| Search between strings with an OR | pbsrinivas | Shell Programming and Scripting | 3 | 07-12-2007 05:46 AM |
| Perl code to search for filenames that contain special characters | jerardfjay | Shell Programming and Scripting | 8 | 01-19-2006 04:31 PM |
| searching for strings/user IP addresses | 30694 | UNIX for Dummies Questions & Answers | 2 | 09-23-2002 03:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
I have 5 files in a directory. emp1_usage.txt emp2_usage.txt emp3_usage.txt emp4_usage.txt emp5_usage.txt I am using sqlldr to get the contents of the above 5 files and store it in a temp table and update my original table using temp table. for f in *emp*.txt do sqlldr usr/passwd control=data.ctl data=$f done Now, the problem i got is: I have a table called 'emdc' in which one column has the values: emp_name ------------ emp1 emp2 emp3 I should dynamically check what are the values in the emdc table and pass to the sqlldr those file-names which have the values in the emdc table. Let me explain Clearly: I should now process only emp1_usage.txt, emp2_usage.txt, emp3_usage.txt into the sqlloader. The script should automatically check for the values in emdc table and process only the 3 files among the 5 files present in the directory. Please send me the snippet of the code. Thanks in advance........... |
|
|||||
|
The script again is,
Code:
#! /bin/sh
while read line
do
emdc_value=${emdc_value}" "`echo $line | awk -F"[ ]*" '{ printf $1 }'`
done < input
for f in $emdc_value
do
sqlldr usr/passwd control=data.ctl data=$f
done
Hope this makes it more clear. After the while loop is read completely, emdc_value should contain the values, emp1, emp2 emp3.. i.e. entries from the input file ( your emdc table). vino |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|