本帖最后由 nbmpe 于 2010-11-14 12:49 编辑
帮看下,下面的代码有什么不对,没有批处理快,我试了下30多M七小时没处理完
另帮解释一下这句。 if not defined %%i set %%i=A & echo %%i>>str_.txtinclude <File.au3>
$aFile = "11.5.txt"
$bFile = "t.txt"
For $i = _FileCountLines($aFile) to 1 Step -1
$x = FileReadLine($aFile, $i)
If $i = _FileCountLines($aFile) Then FileWriteLine($bFile,$x)
$z = 0
For $h = _FileCountLines($bFile) to 1 Step -1
$y = FileReadLine($bFile, $h)
If $x = $y Then $h = 1
If $x <> $y Then $z = $z+1
If $z = _FileCountLines($bFile) Then
FileWriteLine($bFile,$x)
$h = 1
EndIf
Next
Next
MsgBox(0, 0,"fdsf")
#cs
@echo off
:: 删除重复的行,但不能保留空行
:: 对不符合变量命名规则、变量个数超过限制的文本都无法正确处理
::
(echo 清除重复行后的文件内容:& echo.)>str_.txt
for /f "delims=" %%i in (test.txt) do (
if not defined %%i set %%i=A & echo %%i>>str_.txt)
start str_.txt
#ce
|