Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%i in (test.txt) do (
set str=%%i & set "str=!str: =!" & set "str=!str: =!" )
for /l %%j in (0,1,9) do (
if not "!str!"=="" set "str=!str:%%j=!")
for %%k in (a,b,c,d,e,f,g,h,i,j,k,l,m,n,,o,p,q,r,s,t,u,v,w,x,y,z) do (
if not "!str!"=="" set "str=!str:%%k=!")
if not "!str!"=="" (
>>new.txt echo !str!) else (
echo.)
notepad new.txtOriginally posted by youxi01 at 2007-4-28 08:06:
Simple ones can still be handled (without considering special characters, the processing of many spaces is not very reasonable)
Use batch processing to handle it. A simple demonstration code:
@echo off
setlocal enabledelayedexp ...