附件是hfss导出的一个矩形区域(60*40mm)的磁场分布数据,部分数据如下:
Grid Output Min: [0mm -30mm 0mm] Max: [0mm 30mm 40mm] Grid Size: [1mm 0.1mm 0.1mm]
Scalar data "Mag_H"
0.0000000000000000e+000 -2.9999999999999999e-002 0.0000000000000000e+0004.3838206775562810e+002
0.0000000000000000e+000 -2.9999999999999999e-002 1.0000000000000000e-0041.1555410945499389e+003
0.0000000000000000e+000 -2.9999999999999999e-002 2.0000000000000001e-0042.3125474806369130e+003
0.0000000000000000e+000 -2.9999999999999999e-002 3.0000000000000003e-0043.4748214778985262e+003
0.0000000000000000e+000 -2.9999999999999999e-002 4.0000000000000002e-0043.4136810833425889e+003
0.0000000000000000e+000 -2.9999999999999999e-002 5.0000000000000001e-0043.3766783463990409e+003
0.0000000000000000e+000 -2.9999999999999999e-002 6.0000000000000006e-0042.0600293299791447e+003
0.0000000000000000e+000 -2.9999999999999999e-002 6.9999999999999999e-0041.8277363781929014e+003
0.0000000000000000e+000 -2.9999999999999999e-002 8.0000000000000004e-0041.6120639989454787e+003
0.0000000000000000e+000 -2.9999999999999999e-002 9.0000000000000008e-0041.4130121922368767e+003
0.0000000000000000e+000 -2.9999999999999999e-002 1.0000000000000000e-0031.2305809580670962e+003
这里的数据都是科学计数显示,打算在matlab或者tecplot中进行后处理,绘制磁场分布的等势线,请问应该怎么将这些科学计数的数据批量转换为小数?
网上有这样的程序,不知道该在什么环境下运行:
@echo off
for %%a in (*.txt) do (
(for /f "usebackq delims=" %%b in ("%%a") do (
setlocal enabledelayedexpansion
set b=%%b
if !b:18^,1!==e set a==
if !b:19^,1!==e set a==
if not defined a (echo.%%b) else (
for /f "tokens=1,2* delims=e." %%c in ("%%b") do (
set c=%%c&set d=%%d&set e=%%e&set f=!e:2!
if !f:0^,1!==0 set f=!f:1!
if !c:0^,1!==- set g=-&set c=!c:1!
if !c:0^,1!==0 (echo.0) else (
set h=!c!d!
if !e:0^,1!==+ (
set/a f+=1&for %%f in (!f!) do set h=!h:0,%%f!.!h:%%f!
) else (
set/a f-=1&for /l %%f in (1,1,!f!) do set i=!i!0
set h=0.!i!h!
)
for /f "tokens=1* delims=." %%f in ("!h!") do set f=%%g&set h=%%f.!f:0,8!
if !h!==0.00000000 set h=0.00000001
if not "!h:.=!"=="!h!" set "h=!h:0= !"&set "h=!h:.=#!"&for /f "delims=" %%f in ("!h!") do set h=%%ff&set "h=!h:%cd%=!"&set "h=!h:#=.!"&set "h=!h: =0!"
if !h:-1!==. set h=!h:0,-1!
echo.!g!h!)))
endlocal))>"%%a_"
del /q "%%a"
ren "%%a_" "%%a")
这个应该是bat批处理文件
试试excel哈
谢谢,我试下
我也碰见该问题,不知楼主怎么解决的,现在解决了吗?
我弄了一个matlab程序可以实现这个功能,小数精度默认6位,其它需求可以自己改。
出来效果如下
程序如下
,需要回复后才能看到
声明:网友回复良莠不齐,仅供参考。如需更专业、系统的学习HFSS,可以购买本站资深专家讲授的HFSS视频培训课程。