![]() |
|
|
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 |
| Cut the last field | 435 Gavea | Shell Programming and Scripting | 9 | 03-17-2009 01:04 PM |
| Cut last Field | sfaqih | Shell Programming and Scripting | 2 | 11-12-2008 04:46 AM |
| Retrieve 5th Field to Last Field !! | jobbyjoseph | UNIX for Dummies Questions & Answers | 3 | 05-16-2007 04:20 AM |
| Moving Part of a field to another field using AWK | rjsha1 | Shell Programming and Scripting | 5 | 08-04-2006 06:39 AM |
| add increment field when first field changes | azekry | Shell Programming and Scripting | 2 | 11-14-2005 04:21 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Awk and sql field comparation help.
Hi, before my question let me excuse myself for the bad grammar and possible confusion (i am used to write in spanish)*
I need some help, i'm making a query: SELECT empnmbr as empl, origin as addr, old_fields_value as prev_sta, new_fields_value as new_sta \ FROM webapplog$bdate, datachangelog$bdate \ WHERE datachangelog$bdate.webapplog_oid = webapplog$bdate.oid \ AND datachangelog$bdate.table_name = 'address' ORDER BY WEBAPPLOG_OID which returns answers like: empl | addr | prev_sta | new_sta 23424|3030303| 17,1,2,3,4,5,6,7,8|17,2,2,3,4,5,6,7,9 12345|home ad| 18,1,5,1,6,1,16,15|18,2,4,1,6,1,16,19 What i need is to read every line of the answer, compare the differences between the third and fourth fields for every line, and mark in which position of those fields are the differences. so the answer will be more like: empl | addr | prev_sta | new_sta | position 23424|3030303| 1 |2 | 2 23424|3030303| 8 |9 | 9 12345|home ad| 1 |2 | 2 12345|home ad| 5 |4 | 3 12345|home ad| 15 |19 | 8 but i have no idea what to do here. Maybe passing each field to an array and comparing arrays? the third and fourth fields of the original query have always the same number of elements (25) but sometimes only a single element is different. Please any hint is helpful *Si a alguno de los miembros del foro le parece mas simple puedo escribir en espanol y quiza sea mas claro el caso |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|