awk
compares floating point numbers:
I just wrote a new script:
paste \
<(awk -F, '{print $29}' file1 ) \
<(awk -F, '{print $29}' file2 ) \
| awk '{print $1; print $2; print ($1==$2)?"match" :"mismatch"}'
If you do not like breaks, then use printf
instead of print.
Example
Input files
cat file1
12,2,12,12,12,12,3,2,53,6,5474,346,567,6578,89,7689,7,987,69869,1,4,5,4,3,4,2,6,21,832.9,9,2
12,2,12,12,12,12,3,2,53,6,5474,346,567,6578,89,7689,7,987,69869,1,4,5,4,3,4,2,6,21,12.329,9,2
cat file2
12,2,12,12,12,12,3,2,53,6,5474,346,567,6578,89,7689,7,987,69869,1,4,5,4,3,4,2,6,21,832.9000,9,2
12,2,12,12,12,12,3,2,53,6,5474,346,567,6578,89,7689,7,987,69869,1,4,5,4,3,4,2,6,21,832.9000,9,2
Output
% paste <(awk -F, '{print $29}' file1 ) <(awk -F, '{print $29}' file2 ) | awk '{print $1; print $2; print ($1==$2)?"match" :"mismatch"}'
832.9
832.9000
match
12.329
832.9000
mismatch
echo "832.9000 832.9" | awk '$1==$2'
.