本帖最后由 tubaba 于 2017-6-27 15:47 编辑
用 savetocsv将上面的数据写文件是空的?
Func _SaveToCsv1($aArray, $sCsvSavePath)
Local $csv = FileOpen($sCsvSavePath, 2 + 8)
If UBound($aArray, 0) = 1 Then
For $i = 0 To UBound($aArray) - 1
Local $sStr = '"' & StringReplace($aArray[$i], '"', '""') & '"'
FileWriteLine($csv, $sStr)
Next
ElseIf UBound($aArray, 0) = 2 Then
For $i = 0 To UBound($aArray, 1) - 1
Local $sStr = ''
For $j = 0 To UBound($aArray, 2) - 1
$sStr &= '"' & StringReplace($aArray[$i][$j], '"', '""') & '",'
Next
$sStr = StringTrimRight($sStr, 1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sStr = ' & $sStr & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console;加这行调试下,看看控制台输出
FileWriteLine($csv, $sStr)
Next
EndIf
FileClose($csv)
EndFunc ;==>_SaveToCsv1
|