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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 02-10-2009
bogu0001 bogu0001 is offline
Banned
  
 

Join Date: Jan 2009
Posts: 32
merge file with nearest range !!!!!!!

I want join 2 files with range of numbers in ascending order according to the value of the numbers the input will be like this

INPUT

file1
column1 column2
10 14
20 25
56 58
83 90
FILE 2
column1 column 2
1 2
2 8
10 14
20 24
50 58
60 63
70 76
80 100

OUTPUT
col1 col2 col3 col4
1 2
2 8
10 14 10 14
20 25 20 24
56 58 50 58
70 76
83 90 80 100