![]() |
|
|
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 |
| SED - adding blank line after each Range Match | danmauer | Shell Programming and Scripting | 5 | 06-10-2009 05:27 PM |
| read numbers from file and output which numbers belongs to which range | thepurple | Shell Programming and Scripting | 6 | 05-13-2009 07:07 AM |
| Using grep on a range of numbers | ProgChick2oo9 | UNIX for Dummies Questions & Answers | 1 | 03-15-2009 03:58 PM |
| Match a specific IP range | sylaan | Shell Programming and Scripting | 5 | 07-16-2008 07:42 AM |
| grep numbers range | azmathshaikh | Shell Programming and Scripting | 1 | 08-08-2005 08:45 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
match range of different numbers by AWK
if the column1 and 2 in both files has same key (for example "a" and "a1") compare each first key value(a1 of a) of input2 (for example 1-4 or 65-69 not 70-100 or 44-40 etc) with all the values in input1. if the range of first key value in input2 is outof range in input1 values named it as out of range1 or vice versa. some of the key values in input2 are in descending order and some are in ascending order. based on these order we have to name them accordingly as I shown below. If it seems complicated and time consuming please give me any basic idea or approach to compare ranges of 2 files Help would be appreciated Code:
input1 a a1 5-10 30-40 45-60 80-90 100-120 input2 a a1 1-4 a a1 4-1 a a1 120-140 a a1 140-120 a a1 65-69 70-100 a a1 70-65 44-40 a a1 30-33 37-57 63-83 a a1 85-81 30-25 b b1 100-200 c c2 1-200 d d3 2-333 output a a1 1-4 outofrange1 a a1 4-1 outofrange2 a a1 120-140 outofrange3 a a1 140-12 outofrange4 a a1 65-69 inrange1 70-100 a a1 70-65 inrange2 44-40 a a1 30-33 inrange3 37-57 63-83 a a1 85-81 inrange4 30-25 [COLOR="#738fbf"] ---------- Post updated at 01:34 AM ---------- Previous update was at 12:21 AM ---------- ---------- Post updated at 01:35 AM ---------- Previous update was at 01:34 AM ---------- If it seems complicated and time consuming please give me any basic idea or approach to compare ranges of 2 files Last edited by repinementer; 07-21-2009 at 05:38 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|