本帖最后由 pcl_test 于 2015-4-12 22:28 编辑
一行多字- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('type "a.txt"') do (
- set "str=%%a"
- set "str=!str: =!"
- set "$=!str!#"
- set len=&for %%z in (4096 2048 1024 512 256 128 64 32 16) do if !$:~%%z^,1!. neq . set/a len+=%%z&set $=!$:~%%z!
- set $=!$!fedcba9876543210 & set/a len+=0x!$:~16,1! &set/a len-=1
- for /l %%i in (0 1 !len!) do set _"!str:~%%i,1!"=Def
- )
-
- (for /f "delims=" %%a in ('type "b.txt"') do (
- set "str=%%a"
- set "str=!str: =!"
- set "$=!str!#"
- set len=&for %%z in (4096 2048 1024 512 256 128 64 32 16) do if !$:~%%z^,1!. neq . set/a len+=%%z&set $=!$:~%%z!
- set $=!$!fedcba9876543210 & set/a len+=0x!$:~16,1! &set/a len-=1
- for /l %%i in (0 1 !len!) do (
- if not defined _"!str:~%%i,1!" set/p=!str:~%%i,1!<nul
- )
- echo,
- ))>"c.txt"
- pause
复制代码
|