初学AU3,用它给你写一个,思路跟BAT的相同。。。
if fileexists ("new.txt") then filedelete ("new.txt")
$file = Fileopen("a.txt",0)
dim $var1,$var2, $str, $num1, $num2,$enkey=@crlf,$numeric1, $numeric2
while 1
$str = FilereadLine($file)
if @error = -1 then exitloop
$str = StringSplit ($str, ",")
$num1 += 1
$numeric1 +=1
$num2 = $num1 - 1
$numeric2 = $numeric1 - 1
assign ($num1, $str)
assign ("_" & $numeric1,$str)
$s = eval ($num1)
$d = eval ("_" & $numeric1)
$a = eval ($num2)
$e = eval ("_" & $numeric2)
if $num1 > 1 then
$var1 = $s - $a
$var2 = $d - $e
filewrite ("new.txt",$var1 &","&$var2 &$enkey)
endif
wend