marsd,
Sorry.
Here's my example:
file 1
------
contains fields file1_field1 thru file1_field4 with numeric data (double-precision) as:
file1_field1 file1_field2 file1_field3 file1_field4
16:00 10 20 30
16:10 40 50 60
16:20 12 23 14
file 2
------
contains fields file2_field1 thru file2_field4 with numeric data (double-precision) as:
file2_field1 file2_field2 file2_field3 file2_field4
16:00 10 22 31
16:10 20 50 60
16:20 14 29 13
Now, I want to see if row 1, field 3 from file #1 matches row 1, field 3 from file #2 OR row2, field 3 from file #2 OR rowN, field 3, from file #2 (where N is the number of rows in file 2). Once I check to see if row 1, field 3 from file #1 matches all of the corresponding elements in field 3 of file #2, I would index to row 2. Now, I check to see if row 2, field 3 from file #1 matches row 1, field 3 from file #2 OR row 2, field 3 from file #2, and so on.
The output should be:
row 1, field 2 match between files #1 and #2 at row number 1, field #2 (both have a value of 10)
row 2, field 2 match between files #1 and #2 at row number 2, field #2 (both have a value of 50)
and so on ...
output to screen would be:
value of 10 found in row 1
value of 50 found in row 2
Also, I would like to store the row#s and values of the solution in a matrix as follows; for each value in field #1 of:
16:00 10 1
16:10 50 2
16:20 no match
The size of the output file for this script should correspond to the size of file #2, i.e., for every row in file #2, there should either be a value & row number or the text "no match".
Let me know if this is a sufficient input/output description of what I am trying to do.
AwkRookie
Sorry.
Here's my example:
file 1
------
contains fields file1_field1 thru file1_field4 with numeric data (double-precision) as:
file1_field1 file1_field2 file1_field3 file1_field4
16:00 10 20 30
16:10 40 50 60
16:20 12 23 14
file 2
------
contains fields file2_field1 thru file2_field4 with numeric data (double-precision) as:
file2_field1 file2_field2 file2_field3 file2_field4
16:00 10 22 31
16:10 20 50 60
16:20 14 29 13
Now, I want to see if row 1, field 3 from file #1 matches row 1, field 3 from file #2 OR row2, field 3 from file #2 OR rowN, field 3, from file #2 (where N is the number of rows in file 2). Once I check to see if row 1, field 3 from file #1 matches all of the corresponding elements in field 3 of file #2, I would index to row 2. Now, I check to see if row 2, field 3 from file #1 matches row 1, field 3 from file #2 OR row 2, field 3 from file #2, and so on.
The output should be:
row 1, field 2 match between files #1 and #2 at row number 1, field #2 (both have a value of 10)
row 2, field 2 match between files #1 and #2 at row number 2, field #2 (both have a value of 50)
and so on ...
output to screen would be:
value of 10 found in row 1
value of 50 found in row 2
Also, I would like to store the row#s and values of the solution in a matrix as follows; for each value in field #1 of:
16:00 10 1
16:10 50 2
16:20 no match
The size of the output file for this script should correspond to the size of file #2, i.e., for every row in file #2, there should either be a value & row number or the text "no match".
Let me know if this is a sufficient input/output description of what I am trying to do.
AwkRookie