awk
compara os números de ponto flutuante:
Acabei de escrever um novo script:
paste \
<(awk -F, '{print $29}' file1 ) \
<(awk -F, '{print $29}' file2 ) \
| awk '{print $1; print $2; print ($1==$2)?"match" :"mismatch"}'
Se você não gosta de intervalos, use printf
em vez de print.
Exemplo
Arquivos de entrada
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
Saída
% 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