本帖最后由 Five66 于 2023-9-23 18:20 编辑
不知行否,记录内容最好不要有特殊字符
会在当前目录生成新文件2.txt
已编辑- @echo off
-
- set "fpath=D:\DATA\1.txt"
-
- (for /f "usebackq delims=" %%i in ("%fpath%") do (
- set "str=%%i"
- setlocal enabledelayedexpansion
- set str2=!str: =$#$!
- set n=0
- for %%a in (!str2!) do (
- set /a n+=1,m=n%%2
- if !m! equ 0 (
- set "str3=!str3!%%a=="
- ) else (
- set "str3=!str3!%%a="
- )
- )
- if !m! equ 0 (
- set str3=!str3:~0,-2!
- ) else (
- set str3=!str3:~0,-1!
- )
- echo=!str3:$#$= !
- endlocal
- ))>2.txt
-
- pause
复制代码
|