Is this okay?? Limited to output
type test.txt>output.txt
type test.txt>output.txt
正在潜水修练的批处理小白
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!
DigestI
View 19,307 Replies 32
Originally posted by dikex at 2007-5-18 14:13:
Is this okay?? Only for output
type test.txt>output.txt
@echo off
if exist tmp.txt del tmp.txt
set var=
for /f "delims=" %%a in ('findstr /n .* test.txt') do (
set "var=%%a"
call set "var=%%var:"=%%"
call :change
)
goto :eof
:change
set "var=%var:^=^^%"
set "var=%var:>=^>%"
set "var=%var:<=^<%"
set "var=%var:&=^&%"
set "var=%var:|=^|%"
set "var=%var:*:=%"
if not defined var echo.>>tmp.txt & goto :eof
call set "var=%%var:="%%"
call echo.%%var%%>>tmp.txt
@echo off
for /f "delims=" %%a in ('findstr /n .* test.txt') do (
set "var=%%a"
setlocal enabledelayedexpansion
set var=!var:*:=!
echo.!var!
endlocal
)
@echo off
for /f "eol= delims=" %%i in (a.txt) do (
set type=%%i
for /l %%j in (0,1,100) do (
setlocal EnableDelayedExpansion
if "!type:~%%j,1!"==" " (set/p= <nul)
if "!type:~%%j,1!"=="=" (set/p= <nul&set/p==<nul) else (
call set/p="%%type:~%%j,1%%"<nul)
endlocal)
echo.
)
pause>nul