Mac iTOps Tube

Sunday, May 6, 2012

search & merg data from 3 files

i have 3 files which contains as below (example):


Code:


yy-mm-dd  hh:mm:sec  lat          lon        depth mag

[file_1]

Code:


2006-01-01 23:17:26.80  39.8405  41.8795  2.0  3.3

2006-01-06 00:10:26.80  39.9570  41.2130  5.0  3.3

2006-01-06 06:59:02.10  39.4099  44.6065  10.0  3.7


[file_2]

Code:


2006-01-06 13:49:52.70  38.5481  40.7437  6.0  2.5

2006-01-08 20:57:12.50  39.5189  40.8876  31.5  6.1

2006-01-09 01:50:09.10  39.1322  40.3405  5.0  3.4


[file_3]

Code:


2006-01-17 07:44:15.60  38.3730  41.4610  5.6  5.0

2006-01-17 08:30:16.80  38.3405  41.5901  9.7  3.6

2006-01-18 08:50:42.70  39.5115  44.1502  3.7  3.4


i want to search 2nd, 3rd,4th & 6th fields of 3 file instantaneously and find the the values that have 1 minute different in 2nd fields, 1 degree different in 3rd and 4th fields and less than 1 unit in 6th field; then write the records that have all conditions together in output_file.




No comments:

Post a Comment