在一个文本文件中,我有很多行看起来像(a,b,c)
a、b 和 c 是双精度实数,例如(8.27605704077856,0.505526531790625,1.15577754382534e-05)
. 有没有一种简单的方法可以在 Perl 中将小于 10e-4 的数字替换为 0?
编辑:例如,要处理的文本文件如下所示:
\plotinstruction[color,style,width]
points{
(8.27,0.5,1.1e-05)
(8.26,1,4.1e-06)
(8.25,1.5,3e-06)
}
我想写一个新文件:
\plotinstruction[color,style,width]
points{
(8.27,0.5,0)
(8.26,1,0)
(8.25,1.5,0)
}