2019-03-12
您好,暂时没有,个人认为是写入数据时方法不对,正确的方法应该是
Dim 内容 = Array("1","2","2","2","2","2","2","2","2","2","2","2","2","2","2")
换行写入txt文件("txtx","sss",内容)
Function 换行写入txt文件(文件夹名,文件名,内容)
Import "cgc.lua"
Dim 文件路径= GetSdcardDir()&"/"&文件夹名&"/"
Dim txt文件 = 文件路径&文件名&".txt"
If Dir.Exist(文件路径) = 0 Then
Call Dir.Create(文件路径)// 创建文件夹
End If
If Dir.Exist(txt文件) = 0 Then
Call cgc.CreateFile(txt文件)// 创建文件
End If
For i = 1 To UBound(内容)+1
If i = UBOUND(内容) + 1 Then
Call File.Append(txt文件, 内容(i)) //Chr(13)
Else
Call File.Append(txt文件, 内容(i)&"\n") //Chr(13)
End If
Next
End Function
用Trim 函数去掉每行的前后空格.输入到新的TXT内,空行则跳过.