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
storing values in a list or array KiranKumarKarre Shell Programming and Scripting 1 05-08-2009 01:50 AM
Storing Multiple Values in a Variable sandeep_1105 UNIX for Dummies Questions & Answers 1 03-03-2009 01:10 AM
Storing Command Line Values yoursdavinder Shell Programming and Scripting 3 01-30-2009 07:33 AM
Fetching unique values from file shivi707 UNIX Desktop for Dummies Questions & Answers 1 01-09-2009 08:33 AM
Storing values in variable matrixmadhan Shell Programming and Scripting 1 04-01-2005 02:56 AM

Reply
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
  #1 (permalink)  
Old 06-04-2009
singhald singhald is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 15
fetching values using awk and storing into array

hi all

I am using awk utility to parse the file and fetching two different vaues from two different record of a record set.

I am able to see the result, now i want to store the result and perform some check of each values form database to mark valid and invalid.

could you please help me to write korn shell script.

to fetch all values for first pattern from file: awk '/'"$PATTERN1"'/' $FILE |cut -f3 -d ' '|sed 's/ //g'

to fetch all values for second pattern from file: awk '/'"$PATTERN2"'/' $FILE |cut -f3 -d ' '|sed 's/ //g'

the output is coming like

Pattern1

ABC
DEF
ABC
KLM

Pattern2

123
234
abc
r4e

etc.

i need to call oracle store procedure to check for validaity of these values.

Thanks in Advance

Singhal
  #2 (permalink)  
Old 06-04-2009
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,312
One way is to use sqlloader to load the data in a table and validate the data with SQL.
Google for sqlloader if you don't have experience with it.

Regards
  #3 (permalink)  
Old 06-04-2009
singhald singhald is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 15
i want to pass both pattern values as arguments to a sql stored procedure for validation. i am aware about the sqlloader. i want to store both result set into array and access one by one both to validate. could you give me some example in KSH.

Thanks

Singhal
  #4 (permalink)  
Old 06-04-2009
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,312
Quote:
Originally Posted by singhald View Post
i want to pass both pattern values as arguments to a sql stored procedure for validation. i am aware about the sqlloader. i want to store both result set into array and access one by one both to validate. could you give me some example in KSH.

Thanks

Singhal
There are a lot of threads regarding this item, search for sql stored procedure with the search function.

Regards
Reply

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 07:17 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