![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UrgentPlease: compare 1 value with file values eliminating special characters | kittusri9 | Shell Programming and Scripting | 10 | 04-28-2008 04:51 AM |
| compare two col from 2 files, and output uniq from file 1 | pp56825 | Shell Programming and Scripting | 2 | 01-10-2008 11:10 AM |
| I need to extract last column of a file and compare the values | vukkusila | Shell Programming and Scripting | 4 | 08-04-2007 11:21 AM |
| compare 2 files, output dups to file | blt123 | UNIX for Dummies Questions & Answers | 2 | 07-15-2004 10:31 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Aggregate values in a file & compare with sql output
Hi,
I have a file containing the following data: junk123junk723itemcode001qty01price10total10junkjunk junk123junk723itemcode002qty02price10total20junkjunk .. .. .. could be 5000+ lines I have an algo and need a code to implement this: 1. Linecount = wc -l (should give 5000) 2. For i = 1 to linecount (loops 5000 times) 3. pick up the value from total and aggregate them ie 10 + 20 = 30 4. This should be done fr all the lines and the total aggregated total in a variable called TOTAL. 5. The total aggregate should be compared against a database query ie: total_database=`sqlplus -s un/pw@TNS_NAME<<END set pagesize 0 set feedback off set heading off set echo off set verify off select total from results; exit; END` echo "$total_database" If $ total_database = $TOTAL then pass, else echo fail.. Can someone kindly help me out with this.I hope I gave in enough info.. Thanks and Regards, Ron. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|