I tested this script in Numbers v3.5.3
With Numbers v2.x, you will have to edit the two instructions :
if maybe is not in {missing value, “”} then
If my memory is right, when a cell is empty, we don’t get missing value but 0.0.
tell application "Numbers"
tell document 1 to tell sheet 1 to tell table 1
set theValues1 to value of cells of column 3
end tell
tell document 2 to tell sheet 1 to tell table 1
set theValues2 to value of cells of column 3
end tell
end tell
# Now you have two lists containing the values of cells of both columns C.
# You may examine them as you want.
set existingInBothTables to {}
set existingOnlyInFile1 to {}
set existingOnlyInOneFile to {}
set existingOnlyInFile2 to {}
repeat with i from 1 to count theValues1
set maybe to item i of theValues1
if maybe is not in {missing value, ""} then
if maybe is in theValues2 then
set end of existingInBothTables to {maybe, i}
else
set end of existingOnlyInFile1 to {maybe, i}
set end of existingOnlyInOneFile to {maybe, i}
end if
end if
end repeat
repeat with i from 1 to count theValues2
set maybe to item i of theValues2
if maybe is not in {missing value, ""} then
if maybe is in theValues1 then
set end of existingInBothTables to {maybe, i}
else
set end of existingOnlyInFile2 to {maybe, i}
set end of existingOnlyInOneFile to {maybe, i}
end if
end if
end repeat
{existingInBothTables, return, existingOnlyInFile1, return, existingOnlyInOneFile, return, existingOnlyInFile2}
--> {{{56.0, 5}, {23.0, 6}, {56.0, 4}, {23.0, 6}}, "
", {{1.0, 2}, {12.0, 3}, {99.0, 4}}, "
", {{1.0, 2}, {12.0, 3}, {99.0, 4}, {102.0, 2}, {4.0, 3}, {45.0, 5}}, "
", {{102.0, 2}, {4.0, 3}, {45.0, 5}}}
As you may see, for every value reported I report also the rowNum which may be useful for what you want to achieve.
Yvan KOENIG running Yosemite 10.10.5 in French (VALLAURIS, France) vendredi 4 septembre 2015 21:02:20