;– 将数据写入文件中的指定行。
file=A.txt ;新建文件
_数据 = %_数据%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%
%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%;
_数据=`r`n %_数据%
loop 8
{
FileWriteLine(file,_数据,1,1) ;“_数据”里的内容 ,写入第一行,
FileWriteLine( _File, _Data = “”, _Linenum = 1, _Replace = true ) {
FileRead, _FileData, % _File
_DataBefore := Substr( _FileData, 1, Instr( _FileData, “`r`n”, false, 1, _Linenum – 1 ) )
_DataAfter := Substr( _FileData, Instr( _FileData, “`r`n”, false, 1, ( _Replace ? _Linenum : _Linenum – 1 ) ) )
_FileData := _DataBefore . _Data . _DataAfter
FileDelete, % _File
FileAppend, % _FileData, % _File
}
}