我有两个文件:
$cat a.txt
1
72200
1 1.000000000000000
1.109393E+01 3.670034E-01 0.000000E+00
1.109333E+01 3.669835E-01 3.636971E-02
1.110000E+01 0.000000E+00 0.000000E+00
2 1.000000000000000
1.109940E+01 0.000000E+00 3.636971E-02
1.110000E+01 0.000000E+00 0.000000E+00
1.109333E+01 3.669835E-01 3.636971E-02
3 1.000000000000000
1.109333E+01 3.669835E-01 3.636971E-02
1.109153E+01 3.669239E-01 7.269964E-02
1.109940E+01 0.000000E+00 3.636971E-02
$cat b.txt
1
72200
1 1.00000000000000
1.109393E+01 3.670034E-01 0.000000E+00
1.109333E+01 3.669835E-01 3.636971E-02
1.110000E+01 0.000000E+00 0.000000E+00
2 1.00000000000000
1.109940E+01 0.000000E+00 3.636971E-02
1.110000E+01 0.000000E+00 0.000000E+00
1.109333E+01 3.669835E-01 3.636971E-02
3 1.00000000000000
1.109333E+01 3.669835E-01 3.636971E-02
1.109153E+01 3.669239E-01 7.269964E-02
1.109940E+01 0.000000E+00 3.636971E-02
它们之间唯一的区别是一些数字的位置,即它们被放置在距离左侧不同数量的空格处,以及数值精度。我感兴趣的精度最高为 10^-6。如果我只对最高 10^-6 的精度感兴趣,我该如何区分这些文件?我尝试了几个选项,但收效甚微:
1.diff -wy -W 70 a.txt b.txt
1 1
72200 72200
1 1.00000000000 | 1 1.0000000000000
1.109393E+01 3.670034E-01 1.109393E+01 3.670034E-01
1.109333E+01 3.669835E-01 1.109333E+01 3.669835E-01
1.110000E+01 0.000000E+00 1.110000E+01 0.000000E+00
2 1.00000000000 | 2 1.0000000000000
1.109940E+01 0.000000E+00 1.109940E+01 0.000000E+00
1.110000E+01 0.000000E+00 1.110000E+01 0.000000E+00
1.109333E+01 3.669835E-01 1.109333E+01 3.669835E-01
3 1.00000000000 | 3 1.0000000000000
1.109333E+01 3.669835E-01 1.109333E+01 3.669835E-01
1.109153E+01 3.669239E-01 1.109153E+01 3.669239E-01
1.109940E+01 0.000000E+00 1.109940E+01 0.000000E+00
我能做些什么?