- @echo off
- setlocal enabledelayedexpansion
- (for /f "tokens=1-2*" %%a in ('type "1.txt"') do (
- for %%d in (%%c) do (
-
- if "%%d" neq "1.0E+00" (
- set "str1=%%d"
- for /l %%l in (1,1,10) do (
- if defined str1 (
- set "str1=!str1:~1!"
- set "str2=!str2!-"
- )
- )
- set "str=!str! !str2!"
- ) else (
- set "str=!str! 1.0E+00"
- )
-
- set str2=
- )
- rem "第一个数字前面是有空格的",需要保留就在%%a前再加个空格
- echo %%a %%b!str!
- set str=
- ))>2.txt
- pause
复制代码
|