本帖最后由 pcl_test 于 2015-3-4 16:06 编辑
回复 1# 每天几分
字库的内容结构应该比较复杂,你的举例不是很好,可能有些情况没有提到- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('type "字库.txt"') do (
- for %%b in (%%a) do >>$ echo,%%b
- set s=
- for /f "delims=" %%c in ('findstr /v "^~" $') do set "s=!s!%%c "
- del $ 2>nul
- >>tmp echo,!s:~,-1!
- )
- >字库2.txt findstr /c:" " tmp
- del tmp 2>nul
- pause
复制代码
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('type "字库.txt"') do (
- set s=
- for %%b in (%%a) do (
- set "str=%%b"
- if not "!str:~,1!" == "~" set "s=!s!%%b "
- )
- >>$ echo,!s:~,-1!
- )
- >字库2.txt findstr /c:" " $
- del $ 2>nul
- pause
复制代码
|