例如有文件:
12345,
12345,
12346,
12456,
.....
能不能做个批处理判断该文件中的每行是否都相同,如果都相同,则运行某个程序,不同的话,就显示文件的内容.
12345,
12345,
12346,
12456,
.....
能不能做个批处理判断该文件中的每行是否都相同,如果都相同,则运行某个程序,不同的话,就显示文件的内容.
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
for /f "delims=" %%i in (a.txt) do set aa=%%i
for /f "delims=" %%i in (a.txt) do if not "%aa%"=="%%i" goto :ec
notepad.exe
goto :eof
:ec
type a.txt | more
pauseOriginally posted by dikex at 2007-4-7 02:35 AM:
for /f "delims=" %%i in (a.txt) do set aa=%%i
for /f "delims=" %%i in (a.txt) do if not "%aa%"=="%%i" goto :ec
notepad.exe
goto :eof
:ec
type a. ...
for /f "delims=" %%i in (a.txt) do (
set aa=%%i
for /f "delims=" %%i in (a.txt) do if not "%aa%"=="%%i" goto :ec
)
@echo off
set str1=
for /f "delims=" %%i in ('sort test.txt') do (
if not defined str1 (
set "str1=%%i"
) else set "str2=%%i"
)
if "%str1%"=="%str2%" echo (文件的每行内容都相同) else echo 文件的每行内容不完全相同
pause
type 2.txt | find /i "%%i"
if errorlevel 1 echo %%i >>%OutFile%
Originally posted by wudixin96 at 2007-4-6 01:50 PM:
有没试过啊??for /f "delims=" %%i in (a.txt) do set aa=%%i执行完了才执行后面的句子的。
aa的值是a.txt的最后一行。
起码也得
for /f "de ...
Originally posted by lililulula at 2007-4-6 03:40 PM:
5楼的朋友的代码好象有点问题 比如:4567
456
456
...