linux 中将科学计数法转换为数值表示(或将数值转换为科学技术法)
001、科学计数法转换为普通数值表示
root@DESKTOP-1N42TVH:/home/test2# ls a.txt b.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt 4.530733e-01 4.530733e-01 2.264793e-01 2.264793e-01 8.744185e-01 8.744185e-01 5.565876e-01 5.565876e-01 4.296157e-01 4.296157e-01 5.852755e-01 5.852755e-01 8.865728e-01 8.865728e-01 3.353323e-01 3.353323e-01 3.825882e-01 3.825882e-01 root@DESKTOP-1N42TVH:/home/test2# awk '{for(i = 1; i <= NF; i++) {printf("%.7f\t", $i)} {printf("\n")}}' a.txt 0.4530733 0.4530733 0.2264793 0.2264793 0.8744185 0.8744185 0.5565876 0.5565876 0.4296157 0.4296157 0.5852755 0.5852755 0.8865728 0.8865728 0.3353323 0.3353323 0.3825882 0.3825882
002、普通数值用科学计数法表示
root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt 0.4530733 0.4530733 0.2264793 0.2264793 0.8744185 0.8744185 0.5565876 0.5565876 0.4296157 0.4296157 0.5852755 0.5852755 0.8865728 0.8865728 0.3353323 0.3353323 0.3825882 0.3825882 root@DESKTOP-1N42TVH:/home/test2# awk '{for(i = 1; i <= NF; i++) {printf("%e\t", $i)} {printf("\n")}}' a.txt 4.530733e-01 4.530733e-01 2.264793e-01 2.264793e-01 8.744185e-01 8.744185e-01 5.565876e-01 5.565876e-01 4.296157e-01 4.296157e-01 5.852755e-01 5.852755e-01 8.865728e-01 8.865728e-01 3.353323e-01 3.353323e-01 3.825882e-01 3.825882e-01