| rhnaeco 2005-02-22, 2:33 pm |
| I have 2 files. one contains bathymetry with one record per second, with the time (in seconds from midnight) as $1. This needs to be tidally corrected with data from the second file which has time in the same format but each record is 300 seconds apart. I need to look at each line on the bathymetry (1st) file and compare the time reading with that of the tidal file (2nd) and if it is within +299 secs of the time in the first, then I need to +or- $2 (2nd file) with the data in $4.
e.g 1st bathy file
time $2 $3 $4 (depth)
34587 12.45362 45.42572 -16.07
34588 12.45361 45.42573 -16.10
e.g 2nd tide file
time depth
34300 1.98
34600 2.05
hopefully i want to end up with the original bathymetry file but with each second of $4 data tidally corrected.
I hope i can do this with awk as i have used it for the other parts of processing, but if not does anyone know of another way?
thanks in advance
R |