Threshold is less than 0.003 or equal then print the line

Friends,

I have very large data files (File1 and File2).
Search field1 of File1 into Field1 of File2.
If found then do Field1 of File1 MINUS Field1 of File2
if the answer is <= 0.003 (positive or negative) then
print that line from File1.

File1
ABC1231|1.1111|2.2122|3.3133
ABC1232|1.1211|2.2222|3.3233
ABC1233|1.1311|2.2322|3.3333

File2
ABC1231|1.1111|2.2122|3.3133
ABC1232|1.1211|2.2222|3.3233
ABC1233|1.1311|2.2322|3.3333
ABC1234|1.1411|2.2422|3.3433
ABC1235|1.1511|2.2522|3.3533

Thanks,
Prashant

what do you mean by field1 of file1 minus field1 of file2???
1.1111-1.1111
or
2.2122-2.2111???

I am sorry. Let me be more specific.

I have two files. When I do diff I get some difference. Like below.
Up to .003 difference is ok but diff fails the comparision.

File1: ABC1231|-2.306|0.0121|9.766
File2: ABC1231|-2.305|0.0123|9.767

So what I thought was following:
-2.306 minus -2.305 is less than or equal to 0.003 than it pass
0.0121 minus 0.0123 is less than or equal to 0.003 than it pass
9.766 minus 9.767 is less than or equal to 0.003 than it pass

---------- Post updated 07-29-09 at 10:12 AM ---------- Previous update was 07-28-09 at 04:31 PM ----------

Any help please.

All I am trying to do is diff between two files.

File1: ABC1231|-2.306|0.0121|9.766
File2: ABC1231|-2.305|0.0123|9.767

However, the last digit in field 2, 3 and 4 are different it fails.
If the difference of the last digit is less than or equal to .003 than I need to pass.

Any suggestion please.
Thanks,
Prashant

---------- Post updated at 02:37 PM ---------- Previous update was at 10:12 AM ----------

Any suggestion please?

A general suggestion would be:
1.) grep line 1 of both files for the characters up to the pipe character. Save each search as a separate variable.
2.) Compare both variables and if they have the same content, proceed to grep-ing the rest of the contents of line 1 of each file putting each number between pipe characters into separate variables, or even better compare them right in the loop for the desired difference. You could send the output of the loop to standard output via echo at that point...